Info

この質問は閉じられています。 編集または回答するには再度開いてください。

How do I express the error values from math formula with matlab code

1 回表示 (過去 30 日間)
Boyu Liu
Boyu Liu 2019 年 5 月 7 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
The formula is (x1-x2)/(10-2*x1)
And I want to say x1 is not able to equal to 5 in matlab code, how do I express this in codes?
  1 件のコメント
KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 5 月 8 日
編集済み: KALYAN ACHARJYA 2019 年 5 月 8 日
x1=input('Enter x1: ');
x2=input('Enter x2: ');
if x1==5
disp('Invalid x1 value');
else
fun=(x1-x2)/(10-2*x1);
fprintf('The Function value is: %f',fun);
end

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by