Problem with fprintf command (matrix)
Mostrar comentarios más antiguos
So I have a problem with fprintf command(image attached), I'm trying to display this text and XX.XX are my variables
For a weight of XX.XX Newtons, the forces are:
Ax Ay Bx F1 F2
XX.XX XX.XX XX.XX XX.XX XX.XX
Let "ans" be 5x1 column matrix and my code is
fprintf('For a weight of %4.2f Newtons, the forces are:\nAx Ay Bx F1 F2\n%4.2g',weight,ans)
%and the answer I get is below but it's not how I'm trying to do it
For a weight of 50.00 Newtons, the forces are:
Ax Ay Bx F1 F2
-50For a weight of 50.00 Newtons, the forces are:
Ax Ay Bx F1 F2
-50For a weight of 70.71 Newtons, the forces are:
Ax Ay Bx F1 F2
-50
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre MATLAB 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!