MATLAB problem Please attach the code that generates the sam

MATLAB problem. Please attach the code that generates the same output shown on the comman window.

Square squareroots are challenging to calculate manually without a calculator (or MATLAB circlebecause). In the old days, people have been using tables of squareroots to look up a result. See the example below, the first column of values is the while number portion of the operand; the first row of values is the decimal portion of the operand. The table shows the squareroot of the operand. Your assignment is to write a MATLAB program that will create a table which contains the squareroots of values lying between two integers, in steps of 0.1. The two integers will be provided by the user, and the second integer must be greater than the first - be sure to validate them. Have the program generate a table in the format shown. You can use the library function, sqrt (), to computer each squareroot In the example run below, the user supplies two integers, 3 and 10, and the program generates a table of squareroots for values between 3.0 and 9.9, with steps of 0.1. You have the option to use or not to use arrays. Complete one or both. Option 1: No arrays are allowed. Your program does not use or make any arrays/vectors. Your program will only store one squareroot value at a time, and print it before releasing it to the next squareroot value. Option 2: arrays are allowed.

Solution

  

x=input(\'Enter a Integer >0:\');

try

if x<=0

error(\'Error.\')

end

catch error1

  

x=input(\'Error. Enter a Positive Integer:\');

  

end

y=input([\'Enter a Integer >\',num2str(x),\':\']);

try

if y<=x

error(\'Error.\')

end

catch error2

  

y=input( [\'Error.\',\'Enter a Integer >\',num2str(x),\':\']);

  

end

z=x:0.1:(y-0.1);

m=sqrt(z)

d=1;

for g=1:1:(y-x)

S(g,1:10)=m(d:d+9);

d=d+10;

end

vheader = sprintf(\'%d \', x:size(S,1)+1);
theader = sprintf(\'0.%d \', 1:size(S,2));
printmat(S,\'roots\',vheader,theader)

MATLAB problem. Please attach the code that generates the same output shown on the comman window. Square squareroots are challenging to calculate manually witho
MATLAB problem. Please attach the code that generates the same output shown on the comman window. Square squareroots are challenging to calculate manually witho

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site