필터 지우기
필터 지우기

RESIZE 3-D MATRIX

조회 수: 3 (최근 30일)
Julia Linderfalk
Julia Linderfalk 2020년 3월 13일
댓글: Guillaume 2020년 3월 17일
I have imported data as a matrix called A with a size
447 x 370 x 331
How do I RESIZE the matrix to 120 x 100 x 85?
Thanks,
Amanda & Julia
  댓글 수: 3
Julia Linderfalk
Julia Linderfalk 2020년 3월 17일
I don't want a subset of the actual matrix. I want to use all the elements in the matrix but in some way make it smaller, maybe by using the average of some elements? :)
Guillaume
Guillaume 2020년 3월 17일
" I want to use all the elements in the matrix but in some way make it smaller, maybe by using the average of some elements?"
We can't really make the decision for you as to how to make it smaller, particularly as we have no idea what your matrix represents. If your matrix represents samples on a grid you could indeed resample to a coarser grid using an interpolation such as nearest, linear, cubic, or more complex method.
If you don't really know what you want, then perhaps you need to clarify to yourself what it is you're trying to do first.

댓글을 달려면 로그인하십시오.

답변 (1개)

Gaurav Garg
Gaurav Garg 2020년 3월 16일
Hi,
In your case, the original matrix has a total of 54,744,090 (447*370*331) elements, while the resultant matrix has 1,020,000 elements. So, using reshapefunction will give you an error since you cannot change the number of elements of the array. One thing, you could do is to change one of the dimensions to [], which would itself compute that dimension.
However, one thing to be noted is that the product of 2 dimensions should be divisible by the total number of elements (54,744,090).

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by