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
2014-7-3
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!