Question

Question 1 1. Consider the following Matlab program 5 - (2 < 3) & (C2 > 3) 1 (1 - 0)) What is the final value of s? A. True B
Question 3 What is the output of the following code? 14 5 .5 and displa) Question 4 (a) How many times will the display comma
Question 6 Consider the following MATLAB script. What are the values for a, b and c after this is a = run? a-3.2; b=10; C-2;

matlap
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Here's the solution:-

1.B
2.A
3.C
4.B

section break
2.
(a) 4<5 & 6>7
ans = 0

(b)(5=5)|1
parse error:

invalid constant left hand side of assignment

(c)(1 & 1 | 0)
ans = 1

3.>> for i=1:4
a=5
a=a+5
end disp(a)

OUTPUT:-

parse error:

syntax error

>>> end disp(a)

4.(a)>> x=3;
>> while(x<8)
disp('Am I done yet?')
x=x+2.5;
end

OUTPUT:-

Am I done yet?
Am I done yet?

(b)
>> c=0;
>> i=10;
>> while i~=1
c=c+i;
i=i-3;
end

Ans.
The loop will run 3 times

5.
(a)
V~=X
ans =

1 1 1 1

(b)
V==Y
ans = 0


(c)
X+Y/2
ans =

41.500 37.500 38.500 41.500

(d)
X(V~=X)
ans =

7 3 4 7

(e)
Y>7
ans = 1

(f)
Y(Y>7)
ans = 69

6. OUTPUT
>> a
a = 20
>> b
b = 80
>> c
c = 2
>>   

7
(a) No Output since I is less than 5 always, I=1
(b)OUTPUT:-
Move right

  

Add a comment
Know the answer?
Add Answer to:
matlap Question 1 1. Consider the following Matlab program 5 - (2 < 3) & (C2...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT