when i want to get magnitude of vector in command window told me that index exceeds matrix dimensions. although i write true code
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
v=[1 2 3 9 6]
pp=v.^2
Rr=sum(pp)
mag=sqrt(Rr)
disp(mag)
Risposte (1)
Paul
il 11 Mag 2024
Code works here
v=[1 2 3 9 6]
pp=v.^2
Rr=sum(pp)
mag=sqrt(Rr)
disp(mag)
Check
norm(v)
Perhaps you have variable(s) named sum or sqrt or disp in your workspace?
0 Commenti
Vedere anche
Categorie
Scopri di più su Statistics and Machine Learning Toolbox 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!