Error using == Matrix dimensions must agree.
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Alvaro Arenas
le 30 Mai 2015
Modifié(e) : Pronoy Das
le 25 Fév 2021
Hi, I want a solution to this problem. Someone can help me?
Error in operations (line 5)
elseif c == 'multi'
0 commentaires
Réponse acceptée
Star Strider
le 30 Mai 2015
I have no idea what the matrix dimension problem is, since we have only one line of your code. However, the way to compare strings and string variables is to use the strcmp or strcmpi functions.
So the correct syntax for the line you posted would be:
elseif strcmpi(c, 'multi')
7 commentaires
Plus de réponses (1)
Pronoy Das
le 25 Fév 2021
Modifié(e) : Pronoy Das
le 25 Fév 2021
I came across a similar problem. Simply replace the single quotation marks with the double quotation marks, i.e. replace the line in your code with
c == "multi"
0 commentaires
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!