Problem with fprintf command (matrix)
이전 댓글 표시
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
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!