Hi everyone, how to use modalfit command to estimate modal vectors from a frf matrix?

Hi everyone, how to use modalfit command to estimate modal vectors from a frf matrix?

4 件のコメント

KALYAN ACHARJYA
KALYAN ACHARJYA 2018 年 9 月 21 日
@Ayisha, have you checked here?
Ayisha Nayyar
Ayisha Nayyar 2018 年 9 月 21 日
First of all thank you very much for your response. Yes Kalyan, but i am confused in name and value option over here. Moreover, can i put a 2500x21matrix in place of frf in this command.
Ayisha Nayyar
Ayisha Nayyar 2018 年 9 月 22 日
I still feel difficulty in using this command .
Walter Roberson
Walter Roberson 2018 年 9 月 23 日
You have not posted your code or a copy of the error message.

サインインしてコメントする。

回答 (1 件)

Ayisha Nayyar
Ayisha Nayyar 2018 年 9 月 23 日
編集済み: Walter Roberson 2018 年 9 月 23 日
sorry Walter,
here is my code, where, b1 is a FRF matrix of size 2500x21, where 2500 represents frequency range and 21 are the points on beam, on which response is collected by accelerometer.
CODE
function [fn,dr,ms]= modalfit(frf,f,fs,mnum,Name,value)
frf=b1;
f=1:2500;
fs=6400;
mnum=6;
[fn,dr,ms]=modalfit(frf,f,fs,mnum,'FitMethod','lsce');
end
error message:
mnum=6;
[fn,dr,ms]=modalfit(frf,f,fs,mnum,'FitMethod','lsce');
Undefined function or variable 'b1'.
Error in modalfit (line 2)
frf=b1;

5 件のコメント

Walter Roberson
Walter Roberson 2018 年 9 月 23 日
編集済み: Walter Roberson 2018 年 9 月 23 日
You wrote
frf=b1;
Where are you expecting that the value of b1 will be found?
Note that this code will call itself recursively until it hits about 500 levels and then will fail as MATLAB decides you are probably in an endless loop (which you are.) When you design recursive routines (routines that call themselves) it is crucial that before calling yourself again, that you have a test deciding whether you have reached a case you can solve directly without calling yourself again.
In other words...
You seem to be trying to define a routine named "modalfit" that will intercept MATLAB's "modalfit" routine and provide values for some of the parameters, and then call MATLAB's "modalfit". But you are not calling MATLAB's "modalfit": you are calling your own modalfit since you used the same name.
Do not try to define your own function to intercept a MATLAB function of the same name. You can define, for example,
function [fn,dr,ms] = modalfit_b(b1)
frf=b1;
f=1:2500;
fs=6400;
mnum=6;
[fn,dr,ms] = modalfit(frf, f, fs, mnum, 'FitMethod', 'lsce');
end
as this routine does not call itself.
Ayisha Nayyar
Ayisha Nayyar 2018 年 9 月 23 日
Thanks a lot Walter,,,I understand what you said and try to repeat the routine as you have instructed....
Ayisha Nayyar
Ayisha Nayyar 2018 年 9 月 23 日
編集済み: Walter Roberson 2018 年 9 月 23 日
Now i write the following routine
frf=b1;
f=1:2500;
fs=6400;
mnum=6;
[fn,dr,ms] = modalfit(frf, f, fs, mnum, 'FitMethod', 'lsce');
But still error persists. i.e.
Error using modalfit
Too many input arguments.
I suspect that you are using
function [fn,dr,ms] = modalfit(b1)
instead of what I wrote,
function [fn,dr,ms] = modalfit_b(b1)
Ayisha Nayyar
Ayisha Nayyar 2018 年 9 月 24 日
Thanks for your help Walter,even if i wrote: function [fn,dr,ms] = modalfit(b1)
There is error,i.e. function [fn,dr,ms] = modalfit(b1) | Error: Function definitions are not permitted in this context.

サインインしてコメントする。

カテゴリ

ヘルプ センター および File Exchange で Vibration Analysis についてさらに検索

タグ

質問済み:

2018 年 9 月 21 日

コメント済み:

2018 年 9 月 24 日

Community Treasure Hunt

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

Start Hunting!

Translated by