Write a script in Matlab that will do the work that was requ

Write a script in Matlab that will do the work that was required to complete problem 5.3 depicted below. (finding mean, min, max etc). However, the script needs to read in the data from the CSV Randata file provided, and find the statistics for that data in column 1.

0 6.376267 1 8.1059 2 9.260336 3 2.766161 4 70360 5 0630 6 5994 7 0.860408 8 415073 9 733623 10 6.051432

Solution

Here beta is denoted as \'A\'

A=[170,200,160,165,175,155,210,190,180,165,195,200,195,205,190];

[r,c]=size(A);

% calculating the mean, min & max, standard deviation

rowmean=sum(A)/r;
display(rowmean);

C=reshape(A,[],1);
min1=min(C);
max1=max(C);

E=sort(A(:));
num=round((r*c)/2);

if( (mod(r,2)==0) || (mod(c,2)==0) )
     totmedian=(E(num)+E(num+1))/2;
    
else
     totmedian=E(num);
end
display(totmedian);

myvar=zeros([c,1]);
mystd=zeros([c,1]);
for i = 1: c
    diff=A(:,i)-colmean(i);
    myvar(i)=sum(diff.^2)/(r-1);
    mystd(i)=sqrt(myvar(i));
end

display(myvar);
display(mystd);

Write a script in Matlab that will do the work that was required to complete problem 5.3 depicted below. (finding mean, min, max etc). However, the script needs

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site