How do you substitute x(1),x(2),x(3) in place of kp,ki and l respectively?

2 ビュー (過去 30 日間)
Neelanjan Pal
Neelanjan Pal 2020 年 4 月 22 日
編集済み: VBBV 2021 年 9 月 5 日
y=((1/10^(l + 1)*ki*kp*l*sin((pi*l)/2))/(kp + (ki*kp*cos((pi*l)/2))/10^l) - (1/10^(l + 1)*ki^2*kp^2*l*cos((pi*l)/2)*sin((pi*l)/2))/(10^l*(kp + (ki*kp*cos((l*pi)/2))/10^l)^2))/((1/10^(2*l)*ki^2*kp^2*sin((pi*l)/2)^2)/(kp + (ki*kp*cos((l*pi)/2))/10^l)^2 + 1) - (1/(25*((2^(1/2)*10^(1/2))/5 + 1)^2) - (2^(1/2)*10^(1/2))/(100*((2^(1/2)*10^(1/2))/5 + 1)))/(4/(5*((2^(1/2)*10^(1/2))/5 + 1)^2) + 1)
How do you substitute x(1),x(2),x(3) in place of kp,ki and l respectively so that i can convert it into a function in x: @x y ?

回答 (2 件)

James Tursa
James Tursa 2020 年 4 月 22 日
編集済み: James Tursa 2020 年 4 月 22 日
To keep your equation the same, e.g.,
y1 = @(kp,ki,l) ((1/10^(l + 1)*ki*kp*l*sin((pi*l)/2))/(kp + (ki*kp*cos((pi*l)/2))/10^l) - (1/10^(l + 1)*ki^2*kp^2*l*cos((pi*l)/2)*sin((pi*l)/2))/(10^l*(kp + (ki*kp*cos((l*pi)/2))/10^l)^2))/((1/10^(2*l)*ki^2*kp^2*sin((pi*l)/2)^2)/(kp + (ki*kp*cos((l*pi)/2))/10^l)^2 + 1) - (1/(25*((2^(1/2)*10^(1/2))/5 + 1)^2) - (2^(1/2)*10^(1/2))/(100*((2^(1/2)*10^(1/2))/5 + 1)))/(4/(5*((2^(1/2)*10^(1/2))/5 + 1)^2) + 1);
y = @(x) y1(x(1),x(2),x(3));
  1 件のコメント
Neelanjan Pal
Neelanjan Pal 2020 年 4 月 25 日
y =
function_handle with value:
@(x)y1(x(1),x(2),x(3))
Only this is showing and nothing else.

サインインしてコメントする。


VBBV
VBBV 2021 年 9 月 5 日
編集済み: VBBV 2021 年 9 月 5 日
syms kp ki l
y= ((1/10^(l + 1)*ki*kp*l*sin((pi*l)/2))/(kp + (ki*kp*cos((pi*l)/2))/10^l) - (1/10^(l + 1)*ki^2*kp^2*l*cos((pi*l)/2)*sin((pi*l)/2))/(10^l*(kp + (ki*kp*cos((l*pi)/2))/10^l)^2))/((1/10^(2*l)*ki^2*kp^2*sin((pi*l)/2)^2)/(kp + (ki*kp*cos((l*pi)/2))/10^l)^2 + 1) - (1/(25*((2^(1/2)*10^(1/2))/5 + 1)^2) - (2^(1/2)*10^(1/2))/(100*((2^(1/2)*10^(1/2))/5 + 1)))/(4/(5*((2^(1/2)*10^(1/2))/5 + 1)^2) + 1);
yy = subs(y,[kp ki l],[x(1) x(2) x(3)])

カテゴリ

Help Center および File ExchangeNumbers and Precision についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by