Which Version support the new syntax of try statement

I used try function to solve the question with following format: try statements catch exception %here statements end
When this program run in Matlab R2011b, it is OK. But it doesn't work in MATLAB 7.0.
Which version of MATLAB is support the below format with "exception".

2 件のコメント

Andreas Goser
Andreas Goser 2013 年 12 月 3 日
To my best knowledge, your issue is not related to version compatibilty. CAn you share the code that is not working in MATLAB 7.0?
Walter Roberson
Walter Roberson 2013 年 12 月 3 日
Qingping commented
A=rand(3,3);
B=rand(2,2);
try
C = [A; B];
catch err
if strcmp(err.identifier,'MATLAB:catenate:dimensionMismatch')
C={A;B}
end
end
C

サインインしてコメントする。

 採用された回答

Walter Roberson
Walter Roberson 2013 年 12 月 3 日

1 投票

MATLAB 7.4, R2007a was the first version to support the newer syntax.

3 件のコメント

Qingping
Qingping 2013 年 12 月 9 日
thanks.
Qingping
Qingping 2013 年 12 月 12 日
can you tell me how to found your answer? because i want to find which version support "ftp" function?
Andreas Goser
Andreas Goser 2013 年 12 月 12 日
In general, you may find this information in the release notes, but that can be cumbersome. MathWorks support engineers obviously have all access to all releases. For the FTP example. I had a look at the doc archive (you need to be linked to a license with maintenance to be able to see that:
Then I checked R13SP2 (FTP not in), then R2006b (it is in). The you can find it in an iterative way...

サインインしてコメントする。

その他の回答 (1 件)

Qingping
Qingping 2013 年 12 月 3 日
編集済み: Qingping 2013 年 12 月 3 日

0 投票

my code is Similar with the following code:
A=rand(3,3); %3*3 matrix
B=rand(2,2); %2*2 matrix
try
C = [A; B];
catch err
if strcmp(err.identifier,'MATLAB:catenate:dimensionMismatch')
C={A;B}
end
end
C

カテゴリ

ヘルプ センター および File ExchangeSoftware Development についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by