Hi I think you miss the situation of following code:
Temp = [1,2,3;
2,3,4;
3,4,5];
In such case, the goto file reports wrong, Perhaps you should add some judgement on '...,' or in complete sentences.
Diego, thank you for the feedback, but why didn't you rate the file accordingly? :-)
You're right about multiple line inputs, I already did it for the more important ones (FOR, WHILE, IF, BREAK, etc...) but from a programming point of view, doing it for multiple lines distinguished by "..." is pretty simple. I guess this is a reason for an update soon.
Glad the file helped, come again!
How, very good!
I need something exactly like this. In my case, a FOR loop will make my script graceless because the use of cell and text markup in the code.
With your GOTO function, I construct a for loop without identation or a new text markup.
A contribution that I can do to your work is an error that ocurred when my code has construction in more than one line like the following examples:
A = [1, 2, 3, ...
4, 5, 6];
B = [1 2 3
4 5 6];
In these cases, Matlab return that the line is an invalid statement. I guess it do so because your function not treat these statements. You code already do it in FOR, WHILE, IF, etc, statements, only left these others.
Forgime my bad english, I'm from Brazil and not speak english.
Thank you again!
--
Diego da Silva de Medeiros
@nazish,
That's how a proper goto() would work.
If you want the loop to continue iterating, simple use goto() without following it with a return().
E-mail me next time if you have problems before you rate the file.
this function doesn't work inside for loops and if statements, it appears to me if it executes the function once, the for loop doesn't execute the next iteration :( , I tried many times.
Comment only