I am trying to create a 3D matrix in MATLAB. I have followed this example. My code is as such:
A1=zeros(50,2,10);
A1 = [1 2; 2 3; 3 11; 11 12; 11 9; 9 10; 9 7; 7 8; 7 5; 5 6; 5 4; 4 3];
A1(:,:,2) = [1 3; 3 2; 3 4; 3 5; 5 6; 6 7; 6 8; 6 9; 9 10; 10 11; 11 12; 12 13; 11 17; 17 16; 16 14; 14 15; 14 12; 16 18; 18 27; 18 19; 19 20; 20 21; 27 21; 27 26; 21 22; 26 25; 25 24; 24 22; 22 23]
The error I am getting is: Subscripted assignment dimension mismatch.
Where am I going wrong can someone tell me?