x = 3; while (x < 8) disp ('Am I done yet?') x = x + 2.5; end
The following statement explain the “while loop”. It explains that loop will execute till value of x remains less than 8 and it will add 2.5 in original value of x. It will show “Am I done yet?” on the command window till the loop ends and loop will stop executing when the value of x exceed than 8 and the loop will terminate.
Write a MATLAB script that convert the length given in feet and inches into centimeters using the formula 1 inch=2.54 cm. Display the result on the screen.
disp ('converting Ft into Cm')
FeetinCm=(x * 30.48);
disp('Converting Inches into Cm')
Write a MATLAB script to input two integer values and find out whether the first or the second number is greater.