when i want to get magnitude of vector in command window told me that index exceeds matrix dimensions. although i write true code
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
v=[1 2 3 9 6]
pp=v.^2
Rr=sum(pp)
mag=sqrt(Rr)
disp(mag)
1 comentario
Respuestas (1)
Paul
el 11 de Mayo de 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 comentarios
Ver también
Categorías
Más información sobre Logical en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!