The "A" and "B" matrices must have the same number of rows.

14 views (last 30 days)
Hi, this error is occurred...
In flexsspf (line 50)
In untitled34 (line 43)
Error using ss
The "A" and "B" matrices must have the same number of rows.
Error in untitled34 (line 44)
sysansq_equi=ss(Aq,Bq,Cq,Dq);
..after running this script:
addpath('.\Funzioni')
clc
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);
Below, you can see the function 'flexsspf' that I called to make the script work
function [A,B,C,D]=flexsspf(V,PF,FREQ,CSI,type);
PF='',
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
FREQ=zeros(0,2,2)
FREQ1=isempty(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
B1=1;
B2=1;
D1=1;
D2=1;
B=[B1; B2];
D=[D1 D2];
[Br,Bc]=size(B);
[Dr,Dc]=size(D);
m=0;
for i=1:m,
omo(i,i)=2*pi*freq(i);
end
omo=zeros(m,m);
A=[[zeros(m,m),eye(m)];[-omo.^2,-2*0.0024*omo]];
C=[eye(m),zeros(m,m)];
if k1==1 & k2==1
D=[fiin fiinp];
else
if k2==1
D=[fiinp];
else
if k1==1
D=[fiin];
end
end
end
save matlab_a A -ascii
save matlab_b B -ascii
save matlab_c C -ascii
save matlab_d D -ascii
  1 Comment
Matt J
Matt J on 27 Jul 2022
Edited: Matt J on 27 Jul 2022
The error message has revealing information. Have you investigated whether Aq and Bq have the same number of rows?

Sign in to comment.

Answers (0)

Categories

Find more on Numeric Types 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!