what is wrong with fprintf
Mostrar comentarios más antiguos
why does not this function give the full text in fprintf:
function printem(a,b)
fprintf('the first number is %.lf and the second is %.lf\n',a,b)
end
what is displayed in matlab is
>> printem(3,5) the first number is>>
Respuesta aceptada
Más respuestas (2)
Walter Roberson
el 19 de Oct. de 2011
1 voto
You appear to have used %.lf (lower-case L) instead of %.1f (digit one)
Harry MacDowel
el 19 de Oct. de 2011
Try this
fprintf('the first number is %0.1f and the second is %0.1f\n',a,b)
Categorías
Más información sobre Entering Commands en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!