How to write a script
조회 수: 2 (최근 30일)
이전 댓글 표시
채택된 답변
Amit
2014년 1월 19일
Something like this?
function myProg
myMat = input('Enter 4x4 Matrix\n');
Useropt = input('Row [1] Column [2] Single Element [3]\n');
switch Useropt
case 1
val = input('Which Row\n');
disp(myMat(val,:));
case 2
val = input('Which Column\n');
disp(myMat(:,val));
case 3
val1 = input('Which Row\n');
val2 = input('Which Column\n');
disp(myMat(val1,val2));
otherwise
disp('wrong input');
end
end
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!