how can I make a matrix into structure

1 次查看(过去 30 天)
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 个)

类别

Help CenterFile Exchange 中查找有关 Structures 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by