how can I make a matrix into structure

Hi everyone,I have a problem of change the matrix into the structure.
i made the matrix about 6*29539,
pic_pp=85;
cam_num=257;
pindex=zeros(pic_pp^2*cam_num,6);
pindex(:,1)=reshape(X1,pic_pp^2*cam_num,1);%x方向投影點
pindex(:,2)=reshape(Y1,pic_pp^2*cam_num,1);%Y方向投影點
pindex(:,3)=reshape(pic_depths,pic_pp^2*cam_num,1);%深度資訊
pindex(:,4)=reshape(OP_offsetX,pic_pp^2*cam_num,1);%X方向偏移量
pindex(:,5)=reshape(OP_offsetY,pic_pp^2*cam_num,1);%Y方向偏移量
pindex(:,6)=reshape(pic_strenth,pic_pp^2*cam_num,1);%強度資訊
pindex(pindex(:,3)==0,:)=[];%刪除為零資訊
i want to let the first line to be the first structure,and the second line to be the second one,third line to be the third one.
the third structure whitch included the fourth to sixth line of matrix,.How can i built the structure likes this?
T=struct.x(3).y(4).z(4)
ans=[2104 3 24
2315 3 146
1464 3 64
...
]

댓글 수: 1

Rik
Rik 2022년 8월 15일
So you want a struct array? Why don't you make that then? It works the same as any other array.
I also don't understand what your last lines of code are meant to do.

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

답변 (0개)

카테고리

도움말 센터File Exchange에서 Structures에 대해 자세히 알아보기

태그

질문:

2022년 8월 15일

댓글:

Rik
2022년 8월 15일

Community Treasure Hunt

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

Start Hunting!

Translated by