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