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

New to MATLAB?

Thread Subject:
What's the difference?

Subject: What's the difference?

From: Sargondjani

Date: 4 Sep, 2011 13:05:10

Message: 1 of 2

I am running two simulations.
Simulation 1:
This generates an array Aux1, with dimensions (colK,colK,neui).
and then i proceed with the following:

 for i=1:neui;
        [ValT(i,:), IndT(i,:)]=max(Aux1(:,:,i)');

Of this procedure, I need the IndT(i,:). This is a (neui,colK) matrix as it should be.

Now I try to get the same result for simulation 2, but it fails.

Simulation 2:
This generates an array Aux2, with dimensions (colS, colK, colK, neui). So i proceed with the following:

for is=1:colS;
        for i=1:neui;
             [ValT(i,:), IndT(i,:)]=max(Auxt(:,:,i)');

So I reduce the Aux2 matrix to Auxt which has the same dimensions as Aux1. It seems to me that if the matrices Auxt and Aux1 are of the same dimensions, it should yield the same results.

Somehow this does not happen and Matlab returns the error:
"??? Error using ==> ctranspose
Too many output arguments.

Error in ==> Alt1V3 at 227
            [ValT(i,:), IndT(i,:)]=max(Auxt(:,:,i)')';"

I really dont get this. Can somebody explain this to me? Many thanks in advance!!!

Subject: What's the difference?

From: Sargondjani

Date: 4 Sep, 2011 13:31:11

Message: 2 of 2

NEVER MIND!!! I accidently put in a transpose in the second simulation.

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