N-dimensional arrays are not supported.
Show older comments
Hello All
I have a 3d matrix as below:
[l,r,h3]=size(H)
When I want to write eye(), as follows, I get an error.
Aeq=[H1 -eye(l)]
The error is:
N-dimensional arrays are not supported.
How can I solve it?
thanks
1 Comment
Azzi Abdelmalek
on 5 Aug 2016
What is H1?
Accepted Answer
More Answers (1)
Konark Kelaiya
on 6 Aug 2016
Your H1 or H whatever the variable is 3D matrix however when you get the size of H with [I,r,h3] it will return matrix size values e.g if H is of 2x3x2 matrix then using size(H) returns value as I = 2,r =3 and h3 = 2.
Now when you use eye(I) , it will create identity matrix of 2x2 and not 3 dimensional , hence it wont work
you need to use
[H1 - eye([I r h3])]
or [H1 - eye(size(H))]
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!