Norm and mean of a time series

조회 수: 2 (최근 30일)
Haya Ali
Haya Ali 2021년 5월 1일
편집: Haya Ali 2021년 5월 26일
I have a time series x1 and this time series should have zero mean and unit norm. 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

채택된 답변

Dyuman Joshi
Dyuman Joshi 2021년 5월 1일
One of the great features of MATLAB is that the error messages it generates are simple and clear. Norm is an inbuilt function which requires an input to it. Just like you used mean() and length() with input x1, norm requires an input as well.
Also I would suggest you to not use mean, norm etc as variables names as they are inbuilt functions in MATLAB and it is not a good practice.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by