Hi, this error is occurred
Not enough input arguments.
Error in flexsspf (line 34)
PF1=strcmp(PF,'');
this is the script
function [A,B,C,D]=flexsspf(V,PF,FREQ,CSI,type
PF1=strcmp(PF,'');
if PF1==0;
pf=load('pffe.mat');
pf=[pf(:,2:end)];
fiinp=pf;
[m,c]=size(pf);
B2=[zeros(m,c);fiinp];
D2=[zeros(m,c)];
end
FREQ1=strcmp(FREQ,'');
if FREQ1==0;
freq=load('freq_prop.mat');
end
k1=exist('B1');
k2=exist('B2');
if k1==1 & k2==1
B=[B1 B2];
D=[D1 D2];
else
if k2==1
B=B2;
D=D2;
else
if k1==1
B=B1;
D=D1;
end
end
end
[Br,Bc]=size(B);
[Dr,Dc]=size(D);
omo=zeros(m,m);
for i=1:m,
omo(i,i)=2*pi*freq(i);
end
A=[[zeros(m,m),eye(m)];[-omo.^2,-2*0.0024*omo]];
if type ==1
C=[eye(m),zeros(m,m)];
elseif type ==2
C=[-omo.^2,-2*0.0024*omo];
if k1==1 & k2==1
D=[fiin fiinp];
else
if k2==1
D=[fiinp];
else
if k1==1
D=[fiin];
end
end
end
end
save matlab_a A -ascii
save matlab_b B -ascii
save matlab_c C -ascii
save matlab_d D -ascii

댓글 수: 2

Dyuman Joshi
Dyuman Joshi 2022년 7월 27일
What is the full error? How are you calling your function?
hi, that is the complete error
However, I'm calling the function in this way (I'm working with a state space model9
close all
clear all
%%
% DEFINIZIONE PARAMETRI DINAMICI
%DEFINIZIONE vettore frequenze
F_plot=400; %Frequenza limite dell'analisi
df=0.1;
f=[0:df:F_plot];
w=2*pi*f;
%%
% COSTRUZIONE SS
csi=0.0024; % smorzamento percentuale -- 0.05 è il valore nella flexsspf
FREQ_equi=load(['freq_prop.mat']);
pfdx_equi=load(['pffe.txt']);
modi=[1:length(FREQ_equi)]';
gamma_equi=pfdx_equi(:,2); % matrice dei fattori di partecipazione modale
save('PF1_equi.dat','gamma_equi', '-ascii') % | modo | PF1 | PF2 | ... | PFr |
save('FREQ1_equi.dat','FREQ_equi', '-ascii') % | modo | freq
type=1; % 1 se spostamento ( q ), 2 se accelerazione ( q** )
[Aq,Bq,Cq,Dq]=flexsspf('','PF1_equi.dat','FREQ1_equi.dat',csi,type);
sysansq_equi=ss(Aq,Bq,Cq,Dq);

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

답변 (1개)

David Hill
David Hill 2022년 7월 27일

0 개 추천

function [A,B,C,D]=flexsspf(V,PF,FREQ,CSI,type)%missing ')'
PF1=isempty(PF);%recommend using isempty

댓글 수: 1

I was going to comment the same but I tried some things out, strcmp does work what it is intended to
y='';
strcmp(y,'')
ans = logical
1
z='ab';
strcmp(z,'')
ans = logical
0
isequal(y,'')
ans = logical
1
isempty(y)
ans = logical
1

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

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

제품

릴리스

R2022a

질문:

2022년 7월 27일

댓글:

2022년 7월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by