Question: On Wednesday, we talked about the if conditional. Remember, there are three main parts to this. if (condition) % then do this end Let's do

On Wednesday, we talked about the "if" conditional. Remember, there are three main parts to this. if (condition) % then do this end Let's do another conditional using this "if" structure. There is one short segments of code in the template to set up y as a random row vector. Write two "if" conditionals as detailed here. The first if statement must evaluate if the first element of y. is greater than or equal to 5. If it is, then subtract 5 from the first element of y, saving this new value to that first element of y In the second if statement, evaluate if the first element of y. is lesser than the second element of y. If it is, then assign the value of 1 (a logical true) to the variable firstLesserEqualSecond. If it is not, then firstLesserEqualSecond should have a value of 0 (a logical false)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
