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:
Problems whit matrix basic things

Subject: Problems whit matrix basic things

From: Donatello

Date: 25 Jun, 2010 04:30:24

Message: 1 of 2

Help plz!!
First i need save two vectors whit the principal and secundari diagonals of the matrix
2)order the two vectors,(biggest number to the smallest)
3)create a new vector whit ,alternatig all the numbers of the othe vectors
[3 2 1] and [4 1 0]
the new one will be [3 4 2 1 1 0]

Subject: Problems whit matrix basic things

From: dpb

Date: 25 Jun, 2010 04:54:42

Message: 2 of 2

Donatello wrote:
> Help plz!!
> First i need save two vectors whit the principal and secundari diagonals
> of the matrix

doc diag

> 2)order the two vectors,(biggest number to the smallest)

doc sort
doc flipud

> 3)create a new vector whit ,alternatig all the numbers of the othe vectors
> [3 2 1] and [4 1 0]
> the new one will be [3 4 2 1 1 0]

z=[];
x=[3 2 1];
y=[4 1 0];
z(1:2:2*length(x)-1) = x; z(2:2:2*length(x)) = y

--

Tags for this Thread

No tags are associated with 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