cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

Matrix and if statements!

Jonnox
1-Newbie

Matrix and if statements!

Hi all,

After getting the correct answer for the if statement part of my equation see post - Three if Statement Formula‌ (I have altered this figure to exactly what I want now) I now thought it would be great if I could check multiple figures at one time using a matrix for my inputs. I've come across a stopping point straight away!! Booooo

Again I'm not so wise with Mathcad so I look to your guys opinion on this issue I have.

Please find attached the formula I'm currently working on. (Mathcad 15 format)

Best Regards

Jonno

1 REPLY 1
StuartBruff
23-Emerald II
(To:Jonnox)

It's complaining about scalars because when you do vector=scalar, Mathcad returns 0 (because a vector isn't a scalar!).   You need to use the vectorize operator to compare the elements of a vector with a scalar ... and then you need some method of using the resultant vector of true and false (1 and 0).

It's probably simpler to make your expression into a function and call the function with the vectorize operator, or put your expression inside a for loop (and use it in a direct program or inside a function).

Stuart

Top Tags