Multiplication gives wrong answer

Following is my code and TensionData is an array imported from an excel file. comments shows the output of each line.
ave_yeild_ten = mean(TensionData(1:10)); % this = 39.6200
K_B = 2.335;
std_yeild_ten = std(TensionData(1:10)); % this = 0.8108
yeild_ten = (ave_yeild_ten - (K_B * std_yeild_ten))*1000 %come out as 37726.87 but should be 37710.6
i figured that the error is in the part
(K_B * std_yeild_ten)
where it gives 1.8931 instead of 1.90943. what is the reason for this and how do I fix it? thanks!

3 件のコメント

zepp
zepp 2015 年 2 月 24 日
How does 2.335*0.8108 equal 1.90943? It's actually equal to 1.893218.
Adam
Adam 2015 年 2 月 24 日
Where do you get the information from that the answer should be 37710.6?
Zcarfaz
Zcarfaz 2015 年 2 月 24 日
Oh god! I had a typo in my code caused the error. K_B should be 2.355. that was the reason my output and test case output was slightly off. anyway thanks y'all.

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

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeData Import from MATLAB についてさらに検索

質問済み:

2015 年 2 月 24 日

コメント済み:

2015 年 2 月 24 日

Community Treasure Hunt

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

Start Hunting!

Translated by