How to speed the code? It does not want to end processing!!!!
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
R = length(lambda) ;
T = size(X,2) ;
time_dmd = zeros(T-1,R);
for iter = 1:T-1
for p = 1:R
time_dmd(iter,p) = b(p)*(exp(omega(p)*t(iter)));
Xdm(:,iter,p) = real(Phi(:,p)*(b(p).*exp(omega(p)*t(iter))));
end
end
1 Kommentar
Antworten (1)
DGM
am 29 Jun. 2023
Bearbeitet: DGM
am 29 Jun. 2023
Here's my guess.
% assuming b,omega,t are all row vectors
% width of Phi is equal to length of b,omega
time_dmd = b.*exp(omega.*reshape(t(1:end-1),[],1))
Xdm = permute(Phi,[3 2 1]).*time_dmd;
Xdm = real(permute(Xdm,[3 1 2]));
2 Kommentare
Steven Lord
am 29 Jun. 2023
What is the size and class of the variable x that you load from your MAT-file? You can display this information using the whos function.
x = magic(4);
whos x
Siehe auch
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!