How can I read CSV file and plot without removing header?
85 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Md. Imtiaz Kamrul
am 30 Jun. 2022
Kommentiert: Voss
am 30 Jun. 2022
I want to read CSV file without removing header. The first row is the header. I tried with readtable but then I can not able to read the column as well. It is showing Invalid subscript error. I've attached the csv file and code in here.
A= dlmread('v1.csv'); %data read
freq= A(:,1); % it contains the frequency column
S11= A(:,2); % it contains S11 which is 2nd column
S21= A(:,3); % it contains S21 which is 3rd column
figure;
plot(freq,S11,'-','LineWidth',1.5,'color',[30,129,176]/255);
hold on;
plot(freq,S21,'-','LineWidth',1.5,'color',[215,74,31]/255);
0 Kommentare
Akzeptierte Antwort
Voss
am 30 Jun. 2022
A = readtable('v1.csv')
figure;
plot(A{:,1},A{:,2},'-','LineWidth',1.5,'color',[30,129,176]/255);
hold on;
plot(A{:,1},A{:,3},'-','LineWidth',1.5,'color',[215,74,31]/255);
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Spreadsheets finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!