accessing data from 1st row to nth row from two columns and plotting them

조회 수: 13 (최근 30일)
1

채택된 답변

Ameer Hamza
Ameer Hamza 2020년 3월 9일
편집: Ameer Hamza 2020년 3월 9일
You can use the indexing to specify the the rows and columns you want to extract.
data = rand(20, 5); % example matrix
x = data(2:end, 1); % row 2 to 15 from column 1
y = data(2:end, 2); % row 2 to 15 from column 2
plot(x,y);
The above code will extract row 2 to 15 from column 1 and row 2 to 15 from column 2 and plot them.
  댓글 수: 3
Ameer Hamza
Ameer Hamza 2020년 3월 9일
Sousheel Pappu, check the edited answer. You can use end to indicate the last row in the column.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by