How to find the scalar multiple of two vectors?
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Example; a=[1;2;3] and b=[2;4;6], hence the lambda is 2.
0 Commenti
Risposte (1)
James Tursa
il 18 Mag 2018
Modificato: James Tursa
il 18 Mag 2018
E.g., (with some accounting for potential 0 values)
d = b ./ a;
result = mean(d(~isnan(d)));
This is naive code that assumes the same scalar applies to all elements. If it is possible that is not the case, you would need to tell us how to handle the situation.
0 Commenti
Vedere anche
Categorie
Scopri di più su Graphics Object Programming in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!