accessing data from 1st row to nth row from two columns and plotting them
11 views (last 30 days)
Show older comments
Accepted Answer
Ameer Hamza
on 9 Mar 2020
Edited: Ameer Hamza
on 9 Mar 2020
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 Comments
Ameer Hamza
on 9 Mar 2020
Sousheel Pappu, check the edited answer. You can use end to indicate the last row in the column.
More Answers (0)
See Also
Categories
Find more on Spreadsheets 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!