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 Comment

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

Sign in to comment.

Answers (0)

Categories

Asked:

on 3 Jul 2014

Commented:

on 3 Jul 2014

Community Treasure Hunt

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

Start Hunting!