Matlab Help(Programming [matrices])

Status
Not open for further replies.

Nikolas83

Junior Member level 2
Joined
Oct 17, 2006
Messages
20
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,411
Hello guys..
I have the next programm
Ap = zeros(2,2,5);

Ap,:,1) =eye(2);
Ap,:,2) = (zeros);
Ap,:,3) = [0.7 -0.3;0.1 0.7];
Ap,:,4) = (zeros);
Ap,:,5) = [0.7 -0.3;0.1 0.7];
From this programm create 1 3D matrix
A(2,2,5)

That i want its to create a loop..
who examine if any sub-matrix is with zero elements..and if it does then erased this sub-matrix..But i want to start the loop from the last sub-matrix..and it leads too the first one sub-matrices..
Please Help.meeeeeeeeee..
Thanks,,
 


for i=1:5
if(Ap,:,6-i)==zeros(2,2)) Ap,:,6-i)=[]
end
end

only that!!!!!!
 

    Nikolas83

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…