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 件のコメント

Star Strider
Star Strider 2014 年 7 月 3 日
One ( at least I ) would request that you post the entire loop or nested loops encompassing that statement.

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeCreating and Concatenating Matrices についてさらに検索

質問済み:

2014 年 7 月 3 日

コメント済み:

2014 年 7 月 3 日

Community Treasure Hunt

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

Start Hunting!

Translated by