Question: Problem 2 Analyze and predict what one would see as a result of inputting the following four lines into the Command Window of MATLAB. >

Problem 2
Analyze and predict what one would see as a result of inputting the following four lines into the Command Window of MATLAB.
>> x='small cat'
>> y="small cat"
>>3+x
>>3+y
Now enter the 4 lines one by one into the Command Window of MATLAB and observe the results. Write a paragraph explaining what was displayed and why it looked the way it did. (Hint1: try entering 5+y and observing the result).(Hint2: look carefully at slide 15 of the lecture topic PowerPoint file called How Computers Store Variables).
Problem 3
Analyze and predict what one would see as a result of inputting the following commands. Then enter the lines one by one into the Command Window of MATLAB and observe the results. Explain for each line what was displayed and why it looked the way it did.
>>int8(ceil(127.1))
>>uint8(ceil(127.1))
>>int16(ceil(127.1))
>>int8(floor(139.9))
>>uint8(floor(129.9))
>>int8(fix(157.5))
>>int16(fix(157.5))
>>int8(ceil(rem(-528.6,200)))
>>int16(ceil(rem(-528.6,200)))

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!