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

 Akzeptierte Antwort

Thorsten
Thorsten am 11 Nov. 2015

0 Stimmen

if length(dict)=1
newguess=dict
else
%bunch of code
end

3 Kommentare

Max
Max am 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);

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Gefragt:

Max
am 11 Nov. 2015

Kommentiert:

am 12 Nov. 2015

Community Treasure Hunt

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

Start Hunting!

Translated by