n-D look up table editor - adding rows / columns

조회 수: 14 (최근 30일)
Michal Schreiner
Michal Schreiner 2022년 2월 23일
댓글: Voss 2022년 2월 25일
Hello,
I would like to ask if there is possibility to edit look up tables in n-D size (3-D in my case)?
I have matrice 9x5x6 and i need to put these data to the 3-D lookuptable.
For 2-D LUT i found that it is possible to add rows and columns, but not in n-D.
Is there any easy way how to create table from excel data?
Thanks for your help
  댓글 수: 1
Voss
Voss 2022년 2월 25일
It is possible to add new "slices" (i.e. 2D matrices) into a 3D array:
format compact
x = zeros(2,4,3)
x =
x(:,:,1) = 0 0 0 0 0 0 0 0 x(:,:,2) = 0 0 0 0 0 0 0 0 x(:,:,3) = 0 0 0 0 0 0 0 0
new_slice = ones(2,4);
x = cat(3,x(:,:,1:2),new_slice,x(:,:,3))
x =
x(:,:,1) = 0 0 0 0 0 0 0 0 x(:,:,2) = 0 0 0 0 0 0 0 0 x(:,:,3) = 1 1 1 1 1 1 1 1 x(:,:,4) = 0 0 0 0 0 0 0 0
That's a 2-by-4 matrix of all ones being inserted at index 3 in the third dimension of x. You can just as easily insert 2D matrices into a 3D array in any dimension, if the sizes are the same in the other dimensions.
Is this the kind of thing you're asking about?

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

답변 (0개)

카테고리

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

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by