|
|
converting cell array into string |
|
Finn |

Forum-Anfänger
|
 |
Beiträge: 21
|
 |
|
 |
Anmeldedatum: 28.11.12
|
 |
|
 |
Wohnort: ---
|
 |
|
 |
Version: ---
|
 |
|
|
 |
|
Verfasst am: 08.02.2013, 18:05
Titel: converting cell array into string
|
 |
Hey,
I would like to use the cell array <text> in this if-expression:
if text{3,5}~='Vis'
...
end
However I get this error:
Error using ~=
Matrix dimensions must agree.
It seems that <text{3,5}> can only be compared to 'Vis' if it has 3 letters. but if it is made up of e.g. 4 letter ('xxxx') the dimensions dont fit. How can I compare strings of different lengths?
Best regards,
Finn
|
|
|
|
|
Harald |

Forum-Meister
|
 |
Beiträge: 24.501
|
 |
|
 |
Anmeldedatum: 26.03.09
|
 |
|
 |
Wohnort: Nähe München
|
 |
|
 |
Version: ab 2017b
|
 |
|
|
 |
|
Verfasst am: 08.02.2013, 18:58
Titel:
|
 |
Hi,
you should use strcmp for comparing strings.
Best,
Harald
|
|
|
Finn |
Themenstarter

Forum-Anfänger
|
 |
Beiträge: 21
|
 |
|
 |
Anmeldedatum: 28.11.12
|
 |
|
 |
Wohnort: ---
|
 |
|
 |
Version: ---
|
 |
|
|
 |
|
Verfasst am: 11.02.2013, 10:55
Titel:
|
 |
Hi Harald,
thank you very much!
Best,
Finn
|
|
|
|
|
Einstellungen und Berechtigungen
|
|
Du kannst Beiträge in dieses Forum schreiben. Du kannst auf Beiträge in diesem Forum antworten. Du kannst deine Beiträge in diesem Forum nicht bearbeiten. Du kannst deine Beiträge in diesem Forum nicht löschen. Du kannst an Umfragen in diesem Forum nicht mitmachen. Du kannst Dateien in diesem Forum posten Du kannst Dateien in diesem Forum herunterladen
|
|
Impressum
| Nutzungsbedingungen
| Datenschutz
| FAQ
| RSS
Hosted by:
Copyright © 2007 - 2025
goMatlab.de | Dies ist keine offizielle Website der Firma The Mathworks
MATLAB, Simulink, Stateflow, Handle Graphics, Real-Time Workshop, SimBiology, SimHydraulics, SimEvents, and xPC TargetBox are registered trademarks and The MathWorks, the L-shaped membrane logo, and Embedded MATLAB are trademarks of The MathWorks, Inc.
|
|