how to add legend for each of my gains in nyuiqust plot ?

4 ビュー (過去 30 日間)
tomer polsky
tomer polsky 2020 年 6 月 3 日
回答済み: Ananya Tewari 2020 年 6 月 19 日
So I want to ask to make a nyquist olot for diffrent Gains (k) and also that it will be written for each of the nyquist plot what is the current k . how to do it ?
clc;clear all;close all;
% sys = zpk(Z,P,K)
K=[20 30 40 50 60 65]
for i=1:length(K)
sys_1 = zpk([],-1 ,K(i));
sys_2=zpk([],-2 ,1);
sys_3=zpk([],-3,1);
G=sys_1*sys_2*sys_3;
hold on;
figure(i);
nyquist(G);
legend('Gain(K) is=' ,num2str(K(i)'))
end

回答 (1 件)

Ananya Tewari
Ananya Tewari 2020 年 6 月 19 日
Hi Tomer ,
I understand you want different legend according to value of Gain(K)
Rather than using
legend('Gain(K) is=' ,num2str(K(i)')
You can use
value = ['Gain(K) is=', num2str(K(i))];
legend(value)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by