Data is being corrupted in graphs?
Afficher commentaires plus anciens
Hi all, i know this might sound like a trivial question however im quite stumped as to what has happened. Im graphing 2 columns from various csv. files, i have imported this data into matlab.
When i was originally graphing this data, i was getting an output similar to what is seen below (I quickly plotted it in excel) to show the expected data

However, now when i am plotting the data in Matlab it seems to have corrupted itself? Im not sure what the correct terminology is, the first half of the graph seems to be plotted fine, however after a certain point, it looks like some of the amplitude values have been rounded up/ down and it creates an almost square wave for some reason. I have cleared my matlab workspace as well as restarted matlab and imported the data again but the problem still occurs. The issue im facing is shown below.

As i said, this was originally working, and then all of a sudden has decided to plot the graphs like this.
Any support will be appreciated. Thanks in advance
Edit : I have now uploaded the original data csv. file.
timeData = Row1{:, 1}; % Extract the first column (Time)
amplitudeData = Row1{:, 2}; % Extract the second column (Amplitude)
% Create the plot
figure;
plot(timeData, amplitudeData);
xlabel('Time (s)');
ylabel('Amplitude');
title('Time vs Amplitude');
grid on;
2 commentaires
Upload your data by clicking the paperclip button. Preferably in the original data file, otherwise in a MAT file.
It looks as if your time data above 1e-5s has been rounded to the nearest 1e-7. Possibly this is in your original data, possibly it depends on the data type you are using, without seeing your original data we cannot diagnose this.
Jakub Trybek
le 5 Nov 2024
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur 2-D and 3-D Plots dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
