1

I have an array of kxnxmxt. When i retrieve one element it is like A(i,:,:,:) and the result is 1xnxmxt array. I want it to be only nxmxt and i dont want to use reshape for efficiency reasons.

Thanks

Shan
  • 18,563
  • 39
  • 97
  • 132
  • 1
    Duplicates: [How do I get the two last dimensions of an N-D array as a 2D array?](http://stackoverflow.com/questions/5720062/how-do-i-get-the-two-last-dimensions-of-an-n-d-array-as-a-2d-array), [Matlab: how do I change the way a matrix is stored? from 1x1x3 to 1x3?](http://stackoverflow.com/questions/4723563/matlab-how-do-i-change-the-way-a-matrix-is-stored-from-1x1x3-to-1x3) – gnovice May 02 '11 at 15:47
  • hi gnovice this is a duplicate... should i remove the question or to do what??? thanks – Shan May 02 '11 at 15:54
  • It's up to you. You can [flag your question](http://meta.stackexchange.com/questions/24560) and request that a moderator close it or delete it. [Closed questions](http://meta.stackexchange.com/questions/10582/what-is-a-closed-question) that are duplicates are sometimes left around as sign-posts making the older duplicate questions easier to find, and sometimes they are just [deleted](http://meta.stackexchange.com/questions/5221/what-can-cause-a-post-to-be-deleted-and-what-does-that-actually-mean) as unnecessary. If you're unsure, just flag it and ask to have it closed. – gnovice May 02 '11 at 16:22

1 Answers1

3

Try this

squeeze(A(i,:,:,:))

It removes the additional dimension

Chris A.
  • 6,817
  • 2
  • 25
  • 43