Filter löschen
Filter löschen

Help with derivative to plot graph

1 Ansicht (letzte 30 Tage)
raziq halim
raziq halim am 20 Sep. 2020
Beantwortet: Gouri Chennuru am 24 Sep. 2020
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 Kommentar
David Hill
David Hill am 20 Sep. 2020
plot(Theta(1:end-1),diff(y));%assume you wanted y...what is U? Just end Theta 1 less.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Gouri Chennuru
Gouri Chennuru am 24 Sep. 2020
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!

Kategorien

Mehr zu MATLAB Coder finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by