how to import data from csv and plot?
17 views (last 30 days)
I want to import excel dataset (csv file) to matlab and plot.
The first column includes string variables like "2022Q1" , "2022Q2", etc.
The second column is regular data. How can I import that csv and plot 2nd column with respect to 1st column (so the strings be the horizontal axis).
I've tried something like this but doesn't work.
[Array, str, raw]=xlsread('baseline.csv');
y= Array(:, 2);
x= Array (:, 1);
I'm attaching excel file also.
More Answers (2)
Kalpesh Bagmar on 9 Nov 2022
May be you can try following code snippet
a=a(4:end,:) % removing unwanted headings from data
b = cell2mat(a(:,2))
c = a(:,1)