Why am I getting different matrices in workspace and command window?

조회 수: 9 (최근 30일)
Rakesh Belchandan
Rakesh Belchandan 2019년 10월 1일
답변: Rakesh Belchandan 2019년 10월 8일
I am working on a piece of code and I am getting right values in the workspace but not in command window. Why is it happening? Is it any bug in MatLAB?
Thanks,
Rakesh
  댓글 수: 2
Ankit
Ankit 2019년 10월 1일
편집: Ankit 2019년 10월 1일
can you please be more precise what difference you are getting?
it may be because of different format.
Stephen23
Stephen23 2019년 10월 1일
Rakesh Belchandan's "Answer" moved here:
Please see the output from workspace and command window
1.PNG
2.PNG

댓글을 달려면 로그인하십시오.

답변 (2개)

Andreas
Andreas 2019년 10월 1일
I can't see any difference.
Have you already seen the common factor of 1.0 e3 at the top of your command window output?
  댓글 수: 1
Steven Lord
Steven Lord 2019년 10월 1일
I agree with Andreas's assessment. This looks like a display formatting difference, not a difference in the actual values. You can use the format function to change how the matrix is displayed in the Command Window (this has no effect on how the matrix is stored in memory only on how it is displayed) or the options on the View tab in the Toolstrip when the Variable Editor is open and active to change how the matrix is displayed in the Variable Editor, depending on which view you prefer.

댓글을 달려면 로그인하십시오.


Rakesh Belchandan
Rakesh Belchandan 2019년 10월 8일
Thanks for the answer guys. It was format long and format short issue.

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by