Why i got this error Undefined function or variable 'famp'.

조회 수: 5 (최근 30일)
khalifa alebri
khalifa alebri 2017년 12월 16일
편집: YT 2017년 12월 16일
delt=0.005
delt =
0.0050
>> s=2.384e-7
s =
2.3840e-07
>> x=load('AA01.HNE.2013.106.10.39.00');x=detrend(x)*s;plot(x) >> y=load('AA01.HNN.2013.106.10.39.00');y=detrend(y)*s;plot(y) >> z=load('AA01.HNZ.2013.106.10.39.00');z=detrend(z)*s;plot(z) >> whos Name Size Bytes Class Attributes
delt 1x1 8 double
s 1x1 8 double
x 21900x1 175200 double
y 21900x1 175200 double
z 22000x1 176000 double
>> z=z(1:21900); >> m=[x,y,z]; >> whos Name Size Bytes Class Attributes
delt 1x1 8 double
m 21900x3 525600 double
s 1x1 8 double
x 21900x1 175200 double
y 21900x1 175200 double
z 21900x1 175200 double
>> [fm,f]=famp(m,delt); Undefined function or variable 'famp'.
Did you mean: >> [fm,f]=damp(m,delt);
  댓글 수: 2
khalifa alebri
khalifa alebri 2017년 12월 16일
I mean by famp frequency Amplitude
khalifa alebri
khalifa alebri 2017년 12월 16일
all the data in the same directory, FYI the MATLAB is a trial Version and I think its full version with all the functions

댓글을 달려면 로그인하십시오.

답변 (1개)

YT
YT 2017년 12월 16일
편집: YT 2017년 12월 16일
Well in general, it would seem like that you either call a function 'famp' which doesn't exist as a build-in Matlab function (therefor Matlab gives you a suggestion of a build-in function that does exist which is 'damp') or 'famp' is a function you created on your own but it's not in the same directory/environment (or on the Matlab path, like Stephen pointed out).
EDIT
path %check path
addpath('C:\user\my directory') %add to path
  댓글 수: 2
Stephen23
Stephen23 2017년 12월 16일
"ut it's not in the same directory/environment as your main file."
It does not need to be in the same directory, just anywhere on the MATLAB path will do perfectly.
YT
YT 2017년 12월 16일
Well sure, but then you need 'addpath()' if you haven't specified it already. I agree it's easier to do that. I'll edit my statement.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by