Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

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

1 visualización (últimos 30 días)
Boyu Liu
Boyu Liu el 7 de Mayo de 2019
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
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 comentario
KALYAN ACHARJYA
KALYAN ACHARJYA el 8 de Mayo de 2019
Editada: KALYAN ACHARJYA el 8 de Mayo de 2019
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

Respuestas (0)

La pregunta está cerrada.

Community Treasure Hunt

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

Start Hunting!

Translated by