Csv read and figure generation
1 view (last 30 days)
Show older comments
Mohammed Cha
on 8 Nov 2020
Commented: Mohammed Cha
on 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 Comments
Walter Roberson
on 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?
Accepted Answer
Walter Roberson
on 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));
More Answers (0)
See Also
Categories
Find more on Data Import and Export in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!