Plot Not showing all values

21 visualizzazioni (ultimi 30 giorni)
Jun ZHang
Jun ZHang il 26 Mag 2020
Modificato: dpb il 27 Mag 2020
Hi,
I have a couple arrays being created from a CSV file.
Here is my code:
Array=csvread('SampleV5.csv');
col1 = Array(1, :);
col2 = Array(2, :);
plot(col2, col1);
For some reason the plot shows some giant values on the Y axis, even though the max value in the csv is only ~100.
Any ideas?
  1 Commento
dpb
dpb il 27 Mag 2020
Modificato: dpb il 27 Mag 2020
Yeah. There really is at least one giant value in there...
0.300224 0.400304 0.500255 0.600571 0.700721
0 0.01 0.02 0.03 0.04
992008
19.92
Above is a tiny portion of the spreadsheet. I put
=MAX(A1:BXQ1)
=MAX(A2:BXQ2)
in A3 and A4.
In MATLAB, use the alternate optional return index value to find where that value is located and you can then look in that area to see if you can spot what may have happened.
ADDENDUM:
I didn't go look, but this could be another case of missing the decimal point Walter pointed out on the x-value array as well...perhaps that's intended to be 0.992008 instead?

Accedi per commentare.

Risposte (1)

Walter Roberson
Walter Roberson il 27 Mag 2020
The max value of col2 is only about 20, but the maximum value of col1 is 992008
Near 210 the entries go like
21.4239 21.5239 216226 21.7212 21.8214
That suggests to me that you might have accidently omitted some decimal points in entering the data. It looks like every 25th entry that it is happening to.

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by