Switch
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Does matlab consider a complex number a vector, since i tried to make a switch, with a complex number being the decision making element and i got an error...i am going to solve the error, but i need to know if it is not caused by the a matlab compiler definition: complex number = vector ?
0 commentaires
Réponse acceptée
Wayne King
le 8 Avr 2012
No, a complex number is 1x1 in MATLAB, not 2x1
Can you provide an example of where your switch fails?
z = 1+1j;
switch z
case 1+1j
disp('This executes');
case 1+1j*2
disp('This does not');
end
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur MATLAB Report Generator 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!