CAT arguments dimensions not consistent.
Show older comments
Hello,
I am getting the following messages while running the program for multiple values of 'l', (e.g: the program works well by assigning single value to l, like l=5 or l=10, l=15, l=20 etc, but doesnot work for l=5:5:20 or for l=linspace(5,20)).
error: CAT arguments dimensions not consistent.
clear all
syms logP s
P = exp(logP);
N=-P;
% l=10 % program works for individual values of l
l= 10:5:50; % problem encounter unsing a l as a vector
% l=linspace(10,50);
b=0.2;
E=200;n=2;
h0=3; h1=h0;
I0=b.*h0.^3./12; I1=b.*h1.^3./12;
L0=sqrt(P./(E.*I0-P.*n));
L1=sqrt(P./(E.*I1-P.*n));
x=(E.*I1+n.*N)./(E.*I0+n.*N);
a11=sin(L0*s);a12=s;a13=0;a14=0;
a21=0;a22=0;a23=-sin(L1*(l-s));a24=(s-l).*cos(L1*l);
a31=-L0.*cos(L0*s).*cos(L1*l);a32=-cos(L1*l);a33=L1.*cos(L1*(l-s));a34=cos(L1*l);
a41=L0.^2.*sin(L0*s).*cos(L1*l);a42=0;a43=x.*L1.^2.*sin(L1*(l-s));a44=0;
A=[a11 a12 a13 a14;a21 a22 a23 a24;a31 a32 a33 a34;a41 a42 a43 a44];
deltaA=det(A);
s=1;
delta=subs(deltaA,s);
F=matlabFunction(delta);
logP1=[];
for j = log(0.01:10)
logPP = fzero(F, j);
logP1 = vertcat(logP1, logPP);
end
logP1 = [logP1; logPP];
P1 = exp(logP1);
P_cr = min(P1(P1 > 0))
2 Comments
Rik
on 17 May 2021
How would you do this with pen and paper if you have a vector l? Should A be a 3D matrix? Should it be wider? Taller?
It looks like you need a loop. It doesn't look to me like your computations are properly defined for a non-scalar l.
NB: you should avoid lowercase l as a variable name, because it looks a lot like a 1 in many mono-spaced fonts.
HINA
on 17 May 2021
Accepted Answer
More Answers (0)
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!