Error using * (line 334) Dimensions do not match., trying to multiply an array by a constant
Afficher commentaires plus anciens
%Internal virtual work intergrate with limits 0-L (M1)*M1v)/(E*I(x))
%Virtual load = atchual load
x = 0:0.17:L
I = ([b1*(H_o-((H_o-h_o)*x)/L).^3]/12)-([b2*(H_i-((H_o-h_o)*x)/L).^3]/12)
RA1 = (3/8)*w*L
RB1 = (w*L)-RA1
figure(3);
M1 = ((RA1*x)-(w*x.^2)/2)
plot(x,M1)
figure(4);
V = RA1-(w*x)
plot(x,V)
M1v = RA1v*x
figure(5);
Def = (M1*M1v)/(E.*I)
plot(x,Def)
Error using * (line 334)
Dimensions do not match.
Error in codeq1 (line 81)
Def = (M1*M1v)/(E.*I)
i am using this code to try and get the deflection of a point in beam with a varied cross section.
M1,M1v and I all vary with x and i have values for all the points along them buy seting x as 15 separate points between 0 and my beam length.
i am trying to plot 15 points of this equation Def = (M1*M1v)/(E.*I) but i get the error;
i assume its becasue E is a single number
anyone know what i can do to make this run and get the 15 values out
Réponses (1)
Benjamin Thompson
le 4 Fév 2022
0 votes
You have not posted code that defines all the variables. If E is supposed to be scalar, then replace ".*" with juts "*". If the I variable is not supposed to be scalar, use "./" instead of "/"and ensure the size of I is the same size as (M1*M1v).
Def = (M1*M1v)./(E*I)
1 commentaire
gwyn davies
le 4 Fév 2022
Catégories
En savoir plus sur Mathematics dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!