greater than and less than

I cant find format for a command that finds all values between 2 different parameters, it is something like this:
data = sscanf (tempstng, '%d');
If data(4) > 13 & < 15;
Do sequence;
If data(4) > 2 & < 4;
Do Something else;
else sscanf (tempstng, '%d');
end;
Any ideas? Patrick

 Respuesta aceptada

the cyclist
the cyclist el 17 de Feb. de 2011

4 votos

if data(4) > 13 & data(4) < 15
blah blah
elseif data(4) > 2 & data(4) < 4
other blah blah
else
that other thing
end

1 comentario

Patrick
Patrick el 17 de Feb. de 2011
Thanks, Didnt realise I had to state it twice

Iniciar sesión para comentar.

Más respuestas (2)

Paulo Silva
Paulo Silva el 17 de Feb. de 2011

0 votos

data = sscanf (tempstng, '%d');
if ((data(4) > 13) & (data(4)< 15))
disp('if')
elseif ((data(4) > 2) & (data(4)< 4))
disp('elseif')
else
disp('else')
sscanf (tempstng, '%d');
end
LINDANI ZUNGU
LINDANI ZUNGU el 13 de Dic. de 2020

0 votos

how can i write age between 9-12 if age is between the two values ?

Categorías

Más información sobre Characters and Strings en Centro de ayuda y File Exchange.

Preguntada:

el 17 de Feb. de 2011

Respondida:

el 13 de Dic. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by