accessing data from 1st row to nth row from two columns and plotting them
13 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Réponse acceptée
Ameer Hamza
le 9 Mar 2020
Modifié(e) : Ameer Hamza
le 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 commentaires
Ameer Hamza
le 9 Mar 2020
Sousheel Pappu, check the edited answer. You can use end to indicate the last row in the column.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Spreadsheets dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!