MATLAB: Getting error “Subscript indices must either be real positive integers or logical’

# vector normalization

I am getting this error when I run the following commands. Help needed at the earliest.
v=[1 -2 3];
n=norm(v);

Best Answer

It might happen that you have a variable called norm so try the below:
clear all
% or

clear norm
% or
clear norm global
v=[1 -2 3];
n=norm(v);
Also
which norm -all % what shows up
Related Question