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:
how to find values of a matrix

Subject: how to find values of a matrix

From: enviro

Date: 16 Mar, 2009 19:20:18

Message: 1 of 2

a=magic(4)
z=a(:,1);
n=length(z);
for i=1:n;
    for j=i+1:n;
        zz(i,j)=(z(i,1)-z(j,1))^2;
    end
end

I would like to find values of a(:,2:3) for sort(zz(:)). In other words I want to find equivalent values from columns 2 and 3 of matrix a for sort zz values. thanks in advance

Subject: how to find values of a matrix

From: dpb

Date: 17 Mar, 2009 16:47:53

Message: 2 of 2

enviro wrote:
...
> ...I want to find equivalent values from columns 2 and 3 of matrix a
> for sort zz values.

doc sort

Specifically second returned argument

--

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