An open exchange for the MATLAB and Simulink user community |
Hosted by The MathWorks |
|
| Related Topics |
| New Products | Support | Documentation | Training | Webinars | Jobs | Newsletters |
| Problems? Suggestions? Contact us at files@mathworks.com | © 1994-2008 The MathWorks, Inc. Trademarks Privacy Policy |
Hi,
At the end of the video you mentioned that you can do this with matrices by creating a 3D matrix. What would the indices look for that for say a 4×4 matrix?
Y(4,4,i) ?
Kay,
They would look like this:
>> a = rand(4,4,2)
a(:,:,1) =
0.1524 0.0782 0.0046 0.0844
0.8258 0.4427 0.7749 0.3998
0.5383 0.1067 0.8173 0.2599
0.9961 0.9619 0.8687 0.8001
a(:,:,2) =
0.4314 0.1455 0.5499 0.3510
0.9106 0.1361 0.1450 0.5132
0.1818 0.8693 0.8530 0.4018
0.2638 0.5797 0.6221 0.0760
>> a(1,2,2)
ans =
0.1455
Doug