MATLAB is not displaying my numbers as what they should be.

11 ビュー (過去 30 日間)
Farooq
Farooq 2022 年 10 月 4 日
コメント済み: Star Strider 2022 年 10 月 5 日
I am going through the introduction to engineering course on the MATLAB website.
It asks me to plot a stress vs strain graph. I created a variable called data using
data = zeros(10,4)
because I had 10 applied force values and then the 4 columns for further calculations. So created this data variable matrix and entered my values, then I needed to use it to plot. When I open the data variable by clicking on it in the workspace, it shows the correct values, but when I enter data in the command window, it does not show the correct values.
Please help.
when I enter data in command window
when I click data in workspace
  1 件のコメント
Stephen23
Stephen23 2022 年 10 月 4 日
編集済み: Stephen23 2022 年 10 月 4 日
"When I open the data variable by clicking on it in the workspace, it shows the correct values, but when I enter data in the command window, it does not show the correct values."
They look the same to me, just different representations of exactly the same numbers.
Perhaps you are not taking into account the common multiplier at the top:

サインインしてコメントする。

採用された回答

Star Strider
Star Strider 2022 年 10 月 4 日
Use the format function to display the data as you want them.
  2 件のコメント
Farooq
Farooq 2022 年 10 月 5 日
Thank you for your help!
Star Strider
Star Strider 2022 年 10 月 5 日
As always, my pleasure!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeStress and Strain についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by