Multidimensional Array Indexing to Avoid Nested for loops

1 view (last 30 days)
I have to optimize this code avoiding for loops:
for i=1:length(PFVFId.poles)
[T,D]=eig(PFVFId.residue(:,:,i));
for k=1:M
temp = zeros(M,M);
temp(k,k) = D(k,k);
PFVFId.residuediag(:,:,i,k) = T*temp*T';
end
end
How can I make this possible?

Answers (0)

Categories

Find more on Loops and Conditional Statements 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!