1-Visitor
November 29, 2017
Solved
Vector Element - wise If programming
- November 29, 2017
- 2 replies
- 4115 views
Hi,
I have vector and I need to check each element with a condition and the resulting answer should be a vector with the corresponding values if condition is true or false.
Problem: I have a vector called M' with 100 elements in it. I want to check the condition "If (M'<1)". If the condition is true it should assign a new vector Me with M' value in the corresponding position, If the condition is false it should assign 1 to the new vector Me for the corresponding position. I am getting an error stating that the value must be scalar.
I have attached a picture for your reference




