How to ignore domain values to match range values

1 view (last 30 days)
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 Comments
Matt Fig
Matt Fig on 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.

Sign in to comment.

Accepted Answer

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

More Answers (0)

Community Treasure Hunt

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

Start Hunting!