Help with derivative to plot graph

I am trying to plot the derivative of my vector function with another vector but it seems that it wont run because I know that after you derive it would n-1. How do you resolve this problem?
Vtdc = 4.2105*(10^-5);
B = 77;
S = 85.8;
a = S/2;
l = 136.5;
%Solution;
Theta = 0:360;
y = l+a-(sqrt((l^2)-(a^2).*(sind(Theta)).^2)+a.*cosd(Theta));
U = diff(U)
plot(Theta,U)

댓글 수: 1

plot(Theta(1:end-1),diff(y));%assume you wanted y...what is U? Just end Theta 1 less.

댓글을 달려면 로그인하십시오.

답변 (1개)

Gouri Chennuru
Gouri Chennuru 2020년 9월 24일

0 개 추천

Hi Rasiq,
As a workaround, you can use the following code,
Vtdc = 4.2105*(10^-5);
B = 77;
S = 85.8;
a = S/2;
l = 136.5;
Theta = 0:360;
y = l+a-(sqrt((l^2)-(a^2).*(sind(Theta)).^2)+a.*cosd(Theta));
plot(Theta(1:end-1),diff(y));
Hope this Helps!

카테고리

도움말 센터File Exchange에서 MATLAB Coder에 대해 자세히 알아보기

태그

질문:

2020년 9월 20일

답변:

2020년 9월 24일

Community Treasure Hunt

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

Start Hunting!

Translated by