Matrix operation without for loop
Mostra commenti meno recenti
I have a (n,m) matrix T and a (n,1) vector a. I want to divide all the elements of n-th row with the n-th element of the column. Since I want to vectorize the process, I have tried the following
i = (1:n)';
out(i,:) = T(i,:)./a(i);
could it work or am I missing something? The indexing here do work when no component-wise operation is performed.
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Matrix Indexing in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!