필터 지우기
필터 지우기

How to plot both graphs for the given condition, kindely help!

조회 수: 1 (최근 30일)
DEEPAK KARARWAL
DEEPAK KARARWAL 2022년 7월 15일
댓글: Voss 2022년 7월 19일
A=2;
thetap=pi/2;
d=6;
z=0:0.1:6;
if (0 < z <= d/2);
y=2*atan(exp(z*sqrt(A)+thetap))-pi/2;
else z > d/2
y=2*atan(exp(-(z-d)*sqrt(A)+thetap))-pi/2;
end
plot(y,z)

채택된 답변

Voss
Voss 2022년 7월 15일
A=2;
thetap=pi/2;
d=6;
z=0:0.1:6;
y = zeros(size(z));
idx = 0 <= z & z <= d/2; % I imagine you mean 0 <= z, rather than 0 < z
y(idx) = 2*atan(exp(z(idx)*sqrt(A)+thetap))-pi/2;
y(~idx) = 2*atan(exp(-(z(~idx)-d)*sqrt(A)+thetap))-pi/2;
plot(y,z)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

태그

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by