Why are these two variables not the same value?
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Joshua Lucas Ewert
am 10 Dez. 2022
Kommentiert: Joshua Lucas Ewert
am 10 Dez. 2022
I think I'm going crazy because I have two differently named variables both set equal to the same thing but they are returning different values. These are the variables:
Max.H1_E_RT_Moment_Max = max(abs(E.RT_Moment_Y_Ave));
Max.H2_E_RT_Moment_Max_Y = max(abs(E.RT_Moment_Y_Ave));
These are the returned values:
Max.H1_E_RT_Moment_Max = 57.7207
Max.H2_E_RT_Moment_Max_Y = 21.0916
Is there any reason why this might be happening?
5 Kommentare
Walter Roberson
am 10 Dez. 2022
Is it practical to post the code and any relevant data, so we can test?
Akzeptierte Antwort
Walter Roberson
am 10 Dez. 2022
15 lines further down you have
Max.H2_E_RT_Moment_Max_Y = max(abs(E.RT_Moment_Z_Ave));
which overwrites the previous value.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Variables finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!