开发者

How to change dimenssion of a n-d array without using reshape function in matlab?

开发者 https://www.devze.com 2023-03-02 20:06 出处:网络
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.

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.

Than开发者_如何学Pythonks


Try this

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

It removes the additional dimension

0

精彩评论

暂无评论...
验证码 换一张
取 消