How do I make my script / function actually do something?
이전 댓글 표시
I'm running MATLAB R2018b - academic use, and am trying to run the following script saved in a file called problem0611.m. When I select "Run: problem0611", nothing prints to the command window, and nothing is saved to the workspace. I tried removing line 12 and just relying on the workspace, but even then nothing was saved to the workspace. How do I actually run this code? (I did do somet Googling to try to figure this out on my own, but didn't have any luck.)
function problem0611()
m=2;
n=3;
for i = 1:5
A = foo(m,n);
AAT = A*transpose(A);
ATA = transpose(A)*A;
rankAAT = rank(AAT);
detAAT = det(AAT);
rankATA = rank(ATA);
detATA = det(ATA);
A; AAT; rankAAT; detAAT; ATA; rankATA; detATA;
end
fprintf('\n');
end
function [myMatrix] = foo(m,n)
myMatrix = randi(7,m,n)-4*ones(m,n);
end
채택된 답변
추가 답변 (1개)
Nastassja Riemermann
2019년 3월 25일
카테고리
도움말 센터 및 File Exchange에서 Desktop에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!