Question

3. Assume that a = 3; b = 2; c= 5; d = 3; Evaluate the following MATLAB assignment statements: (a) output = a*b+c+d; (b) outp
0 0
Add a comment Improve this question Transcribed image text
Answer #1

To evaluate the given statements, we just initialize the variables a,b,c & d to given values and then execute each statement in the MATLAB command window. After each execution, we can see the value stored in the output variable using the disp command. So the screenshots showing answer to each part are shown below:

a)

>> a = 3; b = 2; >> c = 5; d = 3; >> output = a*b+c*d; >> disp (output) 21

Answer: 21

b)

>> output = a* (b+c) *d; >> disp (output) 63

output = 63

c)

>> output = (a*b)+(c*d); >> disp (output) 21

output = 21

d)

>> output = a^b^d; >>> disp (output) 729

output = 729

e)

>> output = a* (bºd); >> disp (output) 6561

output = 6561

(*Note: Please up-vote. If any doubt, please let me know in the comments)

Add a comment
Know the answer?
Add Answer to:
3. Assume that a = 3; b = 2; c= 5; d = 3; Evaluate the...
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