Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Other Programming (https://www.askmehelpdesk.com/forumdisplay.php?f=437)
-   -   Matlab 'goto' statements (https://www.askmehelpdesk.com/showthread.php?t=140025)

  • Oct 12, 2007, 04:20 PM
    dks2114
    Matlab 'goto' statements
    Okay, so I have previous knowledge of Visual basic and Q-basic and well in these programs if I wanted to go to a certain line I would write 'goto 1' or 'goto line 1' etc. Does anyone know the notation for such a move in Matlab (if this is a legal move in Matlab)?
  • Feb 20, 2008, 09:15 PM
    anandji
    Quote:

    Originally Posted by dks2114
    Okay, so I have previous knowledge of Visual basic and Q-basic and well in these programs if I wanted to go to a certain line i would write 'goto 1' or 'goto line 1' etc. Does anyone know the notation for such a move in Matlab (if this is a legal move in Matlab)?

    Bhvghcv
  • Feb 20, 2008, 09:15 PM
    anandji
    Fhfghgfhgfhj sdfgdfh d
  • Feb 20, 2011, 11:55 PM
    fwety
    MATLAB does not support the use of go to statements on the rationale that it promotes poor programming practice. I suggest writing your code to work with for,while,if-elseif, or switch/case.
    If you're dead set on using go to statements, then you could write your code in FORTRAN (use global variables for scope purposes), and then 'mex' it into MATLAB (using the mex command).

  • All times are GMT -7. The time now is 07:58 AM.