Weird .csv file plot problem
Show older comments
Hey, When I plot from a csv file like so:
K=csvread(b);
plot(K);
I get the correct outcome but the x axis is not the first column as I would like it to be. So I tried this and it didn't work for some reason:
M=csvread(a);
x=M(:,1);
y=M(:,2);
l=M(:,3);
figure (1)
plot(x,y,'g');
hold on
plot(x,l,'r');
I do get a graph with the correct x axis, but the graph is missing many points unlike the previous way where it had all 700000 points. Do I have too many columns for the second way to work? I am using MATLAB 2013b. Thanks
2 Comments
Image Analyst
on 21 Jul 2018
You forgot to attach the files you're using for the badly-named a and b. Please attach them so we can try it and see what the difference is.
Haris Kioleidis
on 21 Jul 2018
Accepted Answer
More Answers (0)
Categories
Find more on 2-D and 3-D Plots 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!