Error using * on matlab basic command

5 次查看(过去 30 天)
Iplaysailing
Iplaysailing 2021-4-29
回答: KSSV 2021-4-29
have an error using the * command not sure how to fix the line of code. it is the last bolded line before the commented out section
clc;
clear ;close all
v=0:0.1:100; % mlp
y = 0.35;
Amplitude = 0.35;
Peroid = 12;
Weight = 155.42;
c = 40;
k = 13.75;
Wn = sqrt(k/Weight);
W = 2*pi/12;
r = Wn/W;
zeta = c/2*(sqrt(Weight*k));
zetasq = zeta^2;
X = y*sqrt((1-r*v*zetasq*r*v.^2)./(((1-r.*v.^2.).^2.)+4*zetasq*r*v.^2.));
%v=0:0.1:100; % mlp
%
% % displacement amplitude
%
% X= 0.45* sqrt( 1+13.050*v.^2 ./( (1-12.745*v.^2 ).^2 +(13.05*v.^2) ) );
%
figure(1)
plot(v,X)
grid on;
xlabel('velocity (Mph)');
ylabel('amplitude of X (ft)');
title('Amplitude of X vs velocity');

回答(1 个)

KSSV
KSSV 2021-4-29
clc;
clear ;close all
v=0:0.1:100; % mlp
y = 0.35;
Amplitude = 0.35;
Peroid = 12;
Weight = 155.42;
c = 40;
k = 13.75;
Wn = sqrt(k/Weight);
W = 2*pi/12;
r = Wn/W;
zeta = c/2*(sqrt(Weight*k));
zetasq = zeta^2;
X = y*sqrt((1-r*v*zetasq*r.*v.^2)./(((1-r.*v.^2.).^2.)+4*zetasq*r.*v.^2.));
%v=0:0.1:100; % mlp
%
% % displacement amplitude
%
% X= 0.45* sqrt( 1+13.050*v.^2 ./( (1-12.745*v.^2 ).^2 +(13.05*v.^2) ) );
%
figure(1)
plot(v,X)
grid on;
xlabel('velocity (Mph)');
ylabel('amplitude of X (ft)');
title('Amplitude of X vs velocity');

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by