Processing a 2d matrix into a 3d and can't avoid a subscripted assignment dimension mismatch.

Hello, I currently have a matrix of the following form
(x)(y)(z)
1 1 1
2 2 1
3 3 1
4 4 1
1 1 2
2 2 2
3 3 2...
The important part being that the third column has several entries of the same value. I was attempting to process it so that I could display all of the entries with the same value at once. My intuition was to convert the original 2-D matrix into a 3-D matrix where the third dimension was determined by the (z) value. So in my code I have the following line:
NewPC(j,:,z) = OldPC(i,:);
At this point I receive my subscripted assignment dimension mismatch. How would one recommend proceeding in order to correct this error?

1 个评论

One ( at least I ) would request that you post the entire loop or nested loops encompassing that statement.

请先登录,再进行评论。

回答(0 个)

类别

帮助中心File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by