0% found this document useful (0 votes)
158 views2 pages

Matlab Ifstatement

matlab prolem

Uploaded by

Bijay Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
158 views2 pages

Matlab Ifstatement

matlab prolem

Uploaded by

Bijay Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 2
srear2ot9 Mathworks Learning Tool Practice if-statements Write a function called picker that takes three input arguments called condition, in1 and in2 in this order. The argument condition is a logical. It is true, the function assigns the value of int to the output argument out, otherwise, it assigns the value of in2 to out. See the examples below to see how picker works in practice. 25 b= 35 picker(acb,a,b) 2 picker(ao,1,-1) ans 1 Function C Reset BB MATLAB Documentation (https:/Avww.mathworks.com/help/) function out = picker(condition, inti, int2) if condition 2 2 3 4 out = inti 5 elseif condition 6 7 a 9 out = int2 else return end Code to call your function C Reset 2 out 2 out picker(true,1,2) picker(false,1,2) (Fanta © hitps:learninglooL mathworks.corviaunch 12 arzazot9 Mathworks Learning Tool Assessment: All Tests Passed Submit @ @ Tre @ False hitps:learninglooL mathworks.corviaunch

You might also like