Hi Husam.. The error was that i never was able to run the code within my code. i was however able to run it without issue in many other applications mainly for testing purposes but for this specific application it was not functioning..
Like John said, this function should only be used in very special cases where you'd write your entire code around the goto() function, like in MoDu's thesis, which is a very special code. Either that or if you just want to have some fun and explore alternative far out MATLAB functionality. That said, you didnt' even write the error, what did it say?
Thank you so much! It works!!! I totally agree with your suggestion but i'm just puzzled how i could have missed out such a simple solution and went around everywhere looking for something much more complex!!
Nevertheless.. Thanks again and Cheers!
Could you kindly clarify the following application of the 'goto' statement please.
I would like to compare random values to an array and generate a new array and am using the 'goto' function within the if/else statement. Somehow it does not seem to work out for me. Could you advise weather i have applied the 'goto' correctly please..
Attached is the erroneous section of my code.
for t = 1:1:14
% LABEL noD
no_of_dev = round(rand*500);
current_max_dev = rg_dev_avail(j:t);
if no_of_dev > current_max_dev
goto('noD') % If condition not satisfied goto label noD
new_rg_dev_list(j:t) = no_of_dev;