what is the difference between A=[]; and A={}; ?
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
what is the difference between A=[]; and A={}; ?
0 commentaires
Réponse acceptée
dbmn
le 18 Nov 2016
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 commentaires
dbmn
le 18 Nov 2016
no. You can still do things like:
>> A=[];
>> A{2}='asdf';
>> class(A)
ans =
cell
without encountering an error
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Logical dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!