Skip to main content
1-Visitor
December 13, 2011
Solved

Conditional function error

  • December 13, 2011
  • 3 replies
  • 5633 views

As part of my coursework, I have to calculate the self-inductance of a single turn coil.

We have been provided with a set of nested equations to estimate the value, which have been presented in mathcad format.

However, when I tried to type in the equation, I got an error telling me the final "otherwise" statement needs to be matched with an "if" statement.

Could someone please point me in the right direction?

Best answer by VladimirN

At you function "otherwise" is used not correctly (not for all expression, but only for the last item).

Pic_2.png

Pic_1.png

3 replies

13-Aquamarine
December 13, 2011

Greg, most likely you did not use the "otherwise" from the programming palet

Greg.gif

VladimirN24-Ruby IIIAnswer
24-Ruby III
December 13, 2011

At you function "otherwise" is used not correctly (not for all expression, but only for the last item).

Pic_2.png

Pic_1.png

Lurky1-VisitorAuthor
1-Visitor
December 13, 2011

Thanks. I didn't realise that I added the "otherwise" in the wrong order.

24-Ruby III
December 14, 2011

You're welcome.

24-Ruby IV
December 13, 2011

I use in same cases if-function:

if.PNG

Lurky1-VisitorAuthor
1-Visitor
December 13, 2011

That is an interesting suggestion. I was unaware that you could nest if statements like that.

24-Ruby IV
December 13, 2011

Greg Milway wrote:

That is an interesting suggestion. I was unaware that you could nest if statements like that.

Thanks. But I think the best solution is - see the picture:

if.png