How to plot 2 coef in matlab to show their relation to each other for specefiec interval -
i've 2 coefficient (ki , kp)
how can plot ki(y axes) , kp(x axes) shows relation each other in 2 axes plot in matlab interval w =(0 , 0.4)?
you have to:
define
omega
data rangeimplement equation of 2 coefficients
kp
,ki
. have make usre use notation./
,.*
,.^
perform these operations on arrays element-wise
use
plot
plotki=f(kp)
onomega
interval
a possible implementation be:
% define omega data omega=0:.01:0.4; % evalaute kp on omega range kp=(38.6068*omega.^2-0.37)./(0.1288*omega.^2+0.1369); % evalaute ki on omega range (also using kp coeff.) ki=(18.58-0.3589*kp).*omega.^2/0.37; % plot data: % x data: kp % y data: ki plot(kp,ki,'r','linewidth',2) grid on % define x axis label xlabel('coeff. kp','fontweight','bold') % define y axis label ylabel('coeff. ki','fontweight','bold') % define title title('ki=f(kp) - \omega=[0:0.4]','fontweight','bold') figure plot(omega,kp,'r','linewidth',2) hold on plot(omega,ki,'b','linewidth',2) grid on legend('kp','ki','location','best') xlabel('\omega','fontweight','bold','fontsize',20)
hope helps.
qapla'
Comments
Post a Comment