"Sean " <sean.dewolski@nospamplease.umit.maine.edu> wrote in message <i4bj1u$rna$1@fred.mathworks.com>...
> "Zain " <nonamenoface@rediffmail.com> wrote in message <i4bi2e$ncd$1@fred.mathworks.com>...
> > ImageAnalyst <imageanalyst@mailinator.com> wrote in message <a388b14a1f6d4145809a387b32d68db7@l20g2000yqm.googlegroups.com>...
> > > Zain:
> > > Do you know that you have a 2D matrix but that you are permuting in
> > > 3D? Perhaps that is what is confusing you. Try asking it to permute
> > > the same number of dimensions as the array has and see if that makes
> > > more sense to you.
> >
> > Yes Imageanalyst, I do realize that i have a matrix of 2 dimension matrix of size 4x3x1.
> > so naturally if I did a permute of the type , permute(A, [2 1]). it invokes the transpose and so on. I understood that fine. but since this matrix still has a value of 1 in the 3D sense, I figured i'll try out the command, permute(A,[2 3 1]) just to see what I would get. I expected MATLAB to produce an error if I tried something 'offlimits or invalid'. But instead it gave me an output, so i tried to figure that out and thats when it got confusing. so is the output a 'correct output' for the command, permute(A,[2 3 1]). if so, could you please show me a little more in detail how it is so ? . Thank you.
>
>
> Yes it is. Your matrix was originally size 3x4x1
> Those sizes corresponding to rows, columns and pages resectively.
>
> It permuted it so that is is to that that the second dimension, cols, is now in the rows place. So there should be 4 rows in the output. You put the third dimension, pages, size 1, in the columns place so that is why your result is showing 1 column. You put the rows, dimension 1 size 3, in the pages place so it should be 3 pages deep. It is, this behavior is expected!
>
> Sean
Thanks sean. that helps. God knows why, I was thinking in terms of the actual rows and columns size rather than the dimensions. Anyway, that helped. adios.
