exiting code if condition is met

I have written a bunch of code but I would like to ignore it if and a condition is met. so for
if length(dict)=1
newguess=dict
end
%bunch of code
I want to ignore all that code if my if statement is met and just stop if length(dict)=1

 Risposta accettata

Thorsten
Thorsten il 11 Nov 2015
if length(dict)=1
newguess=dict
else
%bunch of code
end

3 Commenti

Max
Max il 11 Nov 2015
thanks just a follow up question how do i find the length of a cell. say dict={'aa';'aal';'aalii';'aam';'aani'} dict has 5 words in it how do I find when it has just one for an if statement.
n = numel(dict);
n = numel(dict);

Accedi per commentare.

Più risposte (0)

Richiesto:

Max
il 11 Nov 2015

Commentato:

il 12 Nov 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by