How to do a quick division between a column array and a matrix?
Ältere Kommentare anzeigen
Hello, All,
I want to divid a column array b (N x 1) by each column in a big sparse matrix A (N x M). My code is as follows:
dividCol = zeros(N,M);
for i = 1 : M
nonCol = find(abs(A(:,i))>0);
dividCol(nonCol,i) = b(nonCol)./A(nonCol,i);
end
But it is very slow. I do know if there exist a faster approach to write this code.
Thanks a lot in advance.
Benson
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Electrophysiology finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!