matlab returns different result for same inputs
Mostra commenti meno recenti
hi
i am writing a code. the result is different when i pass varibles to it and when i pass numbers. for axample the value for x in my code is: -0.0424
now when i run this code:
max(min(((x-a)/(b-a)),((c-x)/(c-b))),0)
ans =
0.3159
and when i replace varible x with its value and run this code:
max(min(((-0.0424-a)/(b-a)),((c+0.0424)/(c-b))),0)
ans =
0.3107
the values for a,b and c are the same in both codes.
how can i fix this?
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Variables in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!