Norm and mean of a time series
Show older comments
I am very new to matlab and have a time series x1 and this time series should have zero mean and unit norm. I have been provided with the formula given below to calculate norm and mean But when i run the program it gives me the error shown below. Please help me to resolve the problem.
clear all; close all; clc;
x1=[11500.2 11477.9 11417.3 11426.4 11413 11382.9 11375.1 11347.9 11351.1 11329.3]
mean=mean(x1)
for i=1:length(x1)
x1(i)=(x1(i)-mean)/norm
end
norm=norm(x1)
for i=1:length(x1)
x1(i)=x1(i)/norm
end
%%%Error%%%%
Error using norm
Not enough input arguments.
Error in DMN_ROI (line 27)
x1(i)=(x1(i)-mean)/norm
1 Comment
Atsushi Ueno
on 18 May 2021
Edited: Atsushi Ueno
on 18 May 2021
The error occurs because you are using the variable "norm" before defining it.
x1(i)=(x1(i)-mean)/norm
In line 27, you may think you are using the variable "norm", but since the variable has not been defined yet in line 27, MATLAB is trying to determine that norm is the name of the function, resulting in the error "Not enough input arguments".
Accepted Answer
More Answers (0)
Categories
Find more on Operating on Diagonal Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!