MatLab: I\'m having hard time doing this project, could I have some help? No SIM
ID: 3702340 • Letter: M
Question
MatLab: I'm having hard time doing this project, could I have some help?
Explanation / Answer
Matlab code:
fileroot = ’IQP’;
xlRange = ’A1:Q12’;
MATLABquirk=’.xlsx’;
C=cell(9,5);
C(1,1)=cellstr(’Year’);
C(1,2)=cellstr(’K’);
C(1,3)=cellstr(’BB’);
C(1,4)=cellstr(’K(pfx)’);
C(1,5)=cellstr(’BB(pfx)’);
for k=7:14
nst=int2str(200+k);
st=(200+k);
filename=[fileroot nst MATLABquirk];
M = xlsread(filename, xlRange);
[ndata, text, alldata] = xlsread(filename);
Z=zeros(15);
for i=1:11
Z(i,i+1)=M(i,1);
end
Z(3,4)=0;
Z(6,7)=0;
Z(9,10)=0;
for i=1:9
Z(i,i+3)=M(i,2);
end
for i=10:12
Z(i,14)=M(i,2);
end
for i=1:4
Z(3*i,13)=M(3*i,3);
Z(3*i,3*i)=M(3*i,4);
end
for i=1:12
Z(i,15)=M(i,5);
end
for i=13:15
Z(i,i)=1;
end
A=Z^15;
C(k-5,2)=num2cell(A(1,13));
C(k-5,3)=num2cell(A(1,14));
C(k-5,1)=num2cell(2000+k);
for i=1:11
Z(i,i+1)=M(i,13);
end
Z(3,4)=0;
Z(6,7)=0;
Z(9,10)=0;
for i=1:9
Z(i,i+3)=M(i,14);
end
for i=10:12
Z(i,14)=M(i,14);
end
for i=1:4
Z(3*i,13)=M(3*i,15);
Z(3*i,3*i)=M(3*i,16);
end
for i=1:12
Z(i,15)=M(i,17);
end
for i=13:15
Z(i,i)=1;
end
B=Z^15;
C(k-5,4)=num2cell(B(1,13));
C(k-5,5)=num2cell(B(1,14));
end
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.