How to ignore domain values to match range values

1 vue (au cours des 30 derniers jours)
jjlivestrong
jjlivestrong le 6 Sep 2012
I have this x/y values that does not have the same length. Since x label is the widest, I want to ignore some y values so that I can use them for later plotting.
I am proceding the following way:
c = [1,2,3];
t = [now :1: now + 6]
x = sin(t)
I am trying to generate a code that reads the first n values of x to match the n values of c.
Can you please help?
  2 commentaires
jjlivestrong
jjlivestrong le 6 Sep 2012
I forgot to mention, c = y
Matt Fig
Matt Fig le 6 Sep 2012
What do you mean, "x label is the widest"?
You mention n, but don't show n. Is n the length of c?
x(c) % returns the first 3 values of x.

Connectez-vous pour commenter.

Réponse acceptée

Walter Roberson
Walter Roberson le 6 Sep 2012
x(1:length(c))

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by