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