|
gunposer |

Forum-Newbie
|
 |
Beiträge: 9
|
 |
|
 |
Anmeldedatum: 08.01.11
|
 |
|
 |
Wohnort: ---
|
 |
|
 |
Version: ---
|
 |
|
|
 |
|
Verfasst am: 08.01.2011, 19:33
Titel: FSM switch case
|
 |
Hi, want to set up a FSM. In C it works fine, but matlab breaks loop after got on CASE right. As you see, i wanna jump from one case to the next. Purpose is to read out a package bytewise.
cnt=0;
state=0;
switch state
case 0
state=1;
cnt=cnt+1;
break
case 1
state=2;
cnt=cnt+1;
break
case 2
sprintf('%s','fertsch')
disp('fertsch')
break
otherwise
disp('blabla');
break
end
Any advice?
Kwas
|
|
|
|
|
Jan S |

Moderator
|
 |
Beiträge: 11.057
|
 |
|
 |
Anmeldedatum: 08.07.10
|
 |
|
 |
Wohnort: Heidelberg
|
 |
|
 |
Version: 2009a, 2016b
|
 |
|
|
 |
|
Verfasst am: 08.01.2011, 23:05
Titel: Re: FSM switch case
|
 |
Dear gunposer,
Yes, some.
1. This is a German speaking forum. Please try to formulate your question accordingly.
2. Matlab is not C. Please read the documentation and find out, that SWITCH does not need BREAK in Matlab, although it does in C. Therefore the BREAK is forwarded to the next surrounding FOR or WHILE loop.
Kind regards, Jan
|
|
|
|
|
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.
|
|