function answer=harflertall(a)
if a==50
answer=disp('it''s a tie')
elseif a<50
answer=disp('less than 50')
else
answer=disp('more than 50')
end
can not output be assigned to be a string?

 Respuesta aceptada

Titus Edelhofer
Titus Edelhofer el 31 de Oct. de 2011

1 voto

Hi,
yes it can: disp displays the string in the command window. Just write
answer='less than 50'
Titus

Más respuestas (0)

Categorías

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

Etiquetas

Preguntada:

el 31 de Oct. de 2011

Editada:

el 7 de Abr. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by