Plotting a row from a matrix
166 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
BubbleFlow
le 30 Déc 2018
Commenté : BubbleFlow
le 30 Déc 2018
Hello,
I'm new to matlab. So forgive me if this is a stupid question. I'm analyzing some MATLAB code, and there is a line which plots the 1000th row of a matrix. However I don't understand where the y-values come from. Where do the y-valus come from?
Here is a link to the csv file of INT_I:
The code is:
figure('Name','INT 1000','NumberTitle','off'); hold on;
set(gca,'FontSize',30)
plot(INT_I(1000,:))
legend('1','2','3')
What I get is this:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/199943/image.png)
1 commentaire
Stephen23
le 30 Déc 2018
"Where do the y-valus come from"
Your data.
Where do the X values come from? Read the plot help to find out.
Réponse acceptée
Michael Madelaire
le 30 Déc 2018
Modifié(e) : Michael Madelaire
le 30 Déc 2018
INT_I(1000,:)
That is your y-values
plot(INT_I(1000,:))
Is equivalent to
plot(1:length(INT_I(1000,:)), INT_I(1000,:))
Due tell if it is not clear
2 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Matrix Indexing 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!