필터 지우기
필터 지우기

Line chart in matlab reading data points from file.csv

조회 수: 5 (최근 30일)
chandra Naik
chandra Naik 2020년 9월 4일
댓글: chandra Naik 2020년 9월 6일
Suppose data stored in .csv file .
eg:
Time D1 D2 D3 D4 D5 are in 6 column of csv file. Draw a line chart Time Vs data points (Time in x axis and Data point on y axis )

답변 (1개)

Asad (Mehrzad) Khoddam
Asad (Mehrzad) Khoddam 2020년 9월 4일
% change data.csv to your data file. should be in path
data = csvread('data.csv',1,0) % the first row hold the header
t = data(:,1);
D1 = data(:,2);
D2 = data(:,3);
D3 = data(:,4);
D4 = data(:,5);
D5 = data(:,6);
plot(t,D1,t,D2,t,D3,t,D4,t,D5);
  댓글 수: 1
chandra Naik
chandra Naik 2020년 9월 6일
Index in position 2 exceeds array bounds (must not exceed 1).
Error in test (line 3)
D1 = data(:,2);
aternatively, I used readmatrix and it is working

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by