plotting matrix of unknown size

2 vues (au cours des 30 derniers jours)
Gun Min Song
Gun Min Song le 22 Nov 2018
Commenté : Gun Min Song le 23 Nov 2018
Hi, I am programming a semiconductor characterization system and I need to plot a matrix consisted of data.
The problem is that my script does not know how many curves it should plot before the program execute.
For example if the user decides to have k curves, then the program will generate matrix M of size 255 by 3*k.
Now I need to tell Matlab to plot curves where X is M(:,3*i+2) and Y is M(:,3*i+1) for i = 0 : k-1.
Is there a simple way to tell this to Matlab? Maybe for loop inside the plot function?
I hope my explanation was clear.

Réponse acceptée

Walter Roberson
Walter Roberson le 22 Nov 2018
plot( M(:,2:3:3*k-1), M(:, 1:3:3*k-2) )
  1 commentaire
Gun Min Song
Gun Min Song le 23 Nov 2018
Thanks for your help!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB dans Help Center et File Exchange

Produits


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by