what is the difference between A=[]; and A={}; ?
2 ビュー (過去 30 日間)
古いコメントを表示
what is the difference between A=[]; and A={}; ?
0 件のコメント
採用された回答
dbmn
2016 年 11 月 18 日
One initializes the variable as a double (or array of doubles) and the other as a cell (or a cell array)
>> A=[];
>> class(A)
ans =
double
and
>> B={};
>> class(B)
ans =
cell
2 件のコメント
dbmn
2016 年 11 月 18 日
no. You can still do things like:
>> A=[];
>> A{2}='asdf';
>> class(A)
ans =
cell
without encountering an error
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!