Not enough input arguments.

4 views (last 30 days)
Federico Paolucci
Federico Paolucci on 27 Jul 2022
Commented: Federico Paolucci on 27 Jul 2022
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 Comments
Dyuman Joshi
Dyuman Joshi on 27 Jul 2022
What is the full error? How are you calling your function?
Federico Paolucci
Federico Paolucci on 27 Jul 2022
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);

Sign in to comment.

Answers (1)

David Hill
David Hill on 27 Jul 2022
function [A,B,C,D]=flexsspf(V,PF,FREQ,CSI,type)%missing ')'
PF1=isempty(PF);%recommend using isempty
  1 Comment
Dyuman Joshi
Dyuman Joshi on 27 Jul 2022
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

Sign in to comment.

Categories

Find more on Structures in Help Center and File Exchange

Products


Release

R2022a

Community Treasure Hunt

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

Start Hunting!