Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

If - Then Conditionals Part 2 My Solutions > On Wednesday, we talked about the it' conditional. Remember, there are three main parts to this.

image text in transcribed

If - Then Conditionals Part 2 My Solutions > On Wednesday, we talked about the "it' 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 "ith 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). Script Save e Reset BO MATLAB Documentation 1 This code will create a 1x2 row vector with randomly assigned values. 2 y = round(rand(1,2)*10); 3 4 % Now add your code to evalute the two if statements outlined above, 5 % making sure that firstLesserEqualSecond has the appropriate value once done

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Using Entity Relationship Diagrams

Authors: Sikha Saha Bagui, Richard Walsh Earp

3rd Edition

103201718X, 978-1032017181

More Books

Students also viewed these Databases questions

Question

Differentiate the function. r(z) = 2-8 - 21/2 r'(z) =

Answered: 1 week ago