Effacer les filtres
Effacer les filtres

Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

How do I make this code not return the error "Matrix dimensions must agree."?

1 vue (au cours des 30 derniers jours)
Liam Swift
Liam Swift le 9 Mai 2018
Clôturé : MATLAB Answer Bot le 20 Août 2021
d = 2:.1:6
Sy = 250; % yield stress
Fi = 1000; % N/mm % Preload
kb = 200; % Bolt stiffness
km = 100; % Resultant member stiffness
Se = 50; % Endurance limit
Sut = 450; % Ultimate strength
At = 0.25.*pi.*(d.^2);
t = linspace(0,1.5,1000); % time
P = (2000.*t) - (50.*d.*(t.^3));
Pmin = min(P);
Pmax = max(P);
C = kb/(kb+km); % stiffness
Fbmin = (C*Pmin)+Fi;
Fbmax = (C*Pmax)+Fi;
sigma_a = (Fbmax-Fbmin)/(2*At);
sigma_m = (Fbmax+Fbmin)/(2*At);
sigma_max = Fbmax/(2*At);
n = (Se*Sut)/((sigma_a*Sut)+(sigma_m*Se))
n = -n; % Maximize the safety factor
plot (d,n)

Réponses (1)

IB Ugur
IB Ugur le 9 Mai 2018
Modifié(e) : IB Ugur le 9 Mai 2018
"d" matrix has 41 element so dimension of "d" and "t" dont agree.
P = (2000.*t) - (50.*d.*(t.^3)); check this equation

Cette question est clôturée.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by