Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
plotting graph

Subject: plotting graph

From: James

Date: 3 Feb, 2012 04:37:12

Message: 1 of 3

Hello,
how would I plot the odd-index elements of the vector and plot element of some vector between a range of element like 15 and 25.

Subject: plotting graph

From: dpb

Date: 3 Feb, 2012 19:44:27

Message: 2 of 3

On 2/2/2012 10:37 PM, James wrote:
> Hello, how would I plot the odd-index elements of the vector and plot
> element of some vector between a range of element like 15 and 25.

doc colon

--

Subject: plotting graph

From: Mark Proulx

Date: 3 Feb, 2012 20:26:42

Message: 3 of 3

"James " <tothe1234@yahoo.com> wrote in message <jgfo9o$kp6$1@newscl01ah.mathworks.com>...
> Hello,
> how would I plot the odd-index elements of the vector and plot element of some vector between a range of element like 15 and 25.

Invoke the odd elements of a vector by using the colon (:) operator, viz.,

x = [0 1 2 3 4 5 6 7 8 9];
xodd = x(2:2:end);

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us