フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

I am new to Matlab. Can anyone explain how I get this simple prog to run on my mac?

1 回表示 (過去 30 日間)
Robert Booth
Robert Booth 2015 年 11 月 30 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
%Initialise array
a=[1 -3 2 5];
try
%Try to display an element
index = input('Enter subscript of element to display: ');
disp[('a(int2str.(index))=(num2str.(a(index)')];
catch
%If we get here an error occurred
disp('Illegal subscript:int2str(index)');
end

回答 (2 件)

Thorsten
Thorsten 2015 年 11 月 30 日
編集済み: Thorsten 2015 年 11 月 30 日
a=[1 -3 2 5];
try %Try to display an element
index = input('Enter subscript of element to display: ');
disp(['a(index)= ' int2str(a(index))]);
catch %If we get here an error occurred
disp(['Illegal subscript: ' int2str(index)]);
end

Robert Booth
Robert Booth 2015 年 11 月 30 日
Thank you Thorsten. V helpful answer-I learned a lot Robert Booth

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by