Why am I getting two different plots for the exact same matrix?

1 Ansicht (letzte 30 Tage)
John Vargas am 8 Aug. 2018
Kommentiert: Walter Roberson am 10 Aug. 2018
Hello, I am trying to plot these two matrices. One of them (BFF) I made myself while the other one (SF) is one i found, but I have compared the two and they should be the same (which is what I want, to replicate the Matrix SF). I made the matrix BFF from the vector fM1S1, but when I try to plot the two exact matrix, I get completely different results. Why?
5 Kommentare3 ältere Kommentare anzeigen3 ältere Kommentare ausblenden
John Vargas am 8 Aug. 2018
Here is the single vector I am using to make BFF. Also, @OCDER, I used the 'isequal' command and got a value of 0, meaning they are not equal but they should be. Earlier I used the ' == ' command to check if the matrix were equal and they seemed to match.
Walter Roberson am 9 Aug. 2018
>> max(BFF(:)-SF(:))
ans =
0.00204231
Perhaps you are encountering noticeable round-off error. If you entered data from a printed table, the table might not have shown all of the decimal places the data really had, and that can result in calculations not coming out as you expect them to.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Thorsten am 8 Aug. 2018
Maybe it helps if you transpose the matrix to get it right.
4 Kommentare2 ältere Kommentare anzeigen2 ältere Kommentare ausblenden
John Vargas am 9 Aug. 2018
Bearbeitet: John Vargas am 9 Aug. 2018
I plotted the two matrices to show how far off the results were and as you can see from the picture, I believe the different is very large.
Walter Roberson am 10 Aug. 2018
As outsiders, we have no reason to expect that the two matrices should be the same.
>> max(BFF(:))
ans =
0.00204256
>> max(SF(:))
ans =
2.5e-07
>> min(BFF(:))
ans =
0
>> min(SF(:))
ans =
0
You can see from these values that it is pretty certain that there will be some point where the difference between the two exceeds 0.002, or roughly a factor of 8000 compared to the smaller matrix.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Line Plots 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!

Translated by