Condition for output result
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Aknur
el 6 de Oct. de 2022
Hi !
I want to create function and if result of my x1 will be more than 5.0 then request to assume as a result of x1 = 5.0
Or create variables for my output x1, y1. z1 as I have limitation for them
x1 no more than 5.0, and no less than 0 and if bigger then give an answer as 5.0
y1 the same
And for z1 no more than 3.0
0 comentarios
Respuesta aceptada
Alan Stevens
el 6 de Oct. de 2022
Instead of
x1 = x0+B;
how about
x1 = max(min(x0+B,5.0),0);
2 comentarios
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!