Azzera filtri
Azzera filtri

Csv read and figure generation

1 visualizzazione (ultimi 30 giorni)
Mohammed Cha
Mohammed Cha il 8 Nov 2020
Commentato: Mohammed Cha il 8 Nov 2020
Hello everyone,
I am new on Matlab and need one help. At attached my csv data which i want to read on matlab and want to create a figure ( Column B on X axis and Column C on Y axis). It is basically ratingtime vs Velocity.
Could you please help me ?
Thank you very much in advance
  2 Commenti
Walter Roberson
Walter Roberson il 8 Nov 2020
What is the expected interpretation of
09276215;0;;;;;;;;
3943927;-3
Your column 1 is all 0 until row 1264, and column 2 has leading digits that are increasing up to that point. Then at row 1264 column 1 becomes 1 and the leading digit of column 2 goes back to 0. It looks to me as if column 1 and column 2 together form a number.
Question: has this been produced on a system that uses comma as a decimal separator, and semicolon as the field separator?
Mohammed Cha
Mohammed Cha il 8 Nov 2020
Thank you for the feedback. Sorry i forgot to change the comma symbol as it is in german version. I have updated it in english version. column 2 is time and column 3 is velocity.
Thank you in advance

Accedi per commentare.

Risposta accettata

Walter Roberson
Walter Roberson il 8 Nov 2020
S = fileread('myData.csv');
S(S==',') = '.';
data = cell2mat( textscan(S, repmat('%f', 1, 11), 'Delimiter', ';', 'headerlines', 1));
plot(data(:,2), data(:,3));
  1 Commento
Mohammed Cha
Mohammed Cha il 8 Nov 2020
Hello Walter, I have a small question on your code. Yes i need to plot column 1 and 3 as its time and velocity. I had did mistake in csv. I just edited the code and tried to make figure as attached. Could you please help me to remove noise from it? marking in figure stets which i need to plot other things (such as second wave after first wave) want to remove. My samling rate is 10000Hz.
S = fileread('RawData.csv');
S(S==',') = '.';
data = cell2mat( textscan(S, repmat('%f', 1, 11), 'Delimiter', ';', 'headerlines', 1));
time=data(:,1)
t=time(3:end)
Measured_signal_=data(:,3)
Measured_signal=Measured_signal_(3:end)
plot(t,Measured_signal)

Accedi per commentare.

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by