凡例の系列名に変数の値を入れたいです
Show older comments
凡例に変数のなかの値をいれたいです。方法があれば教えて欲しいです。
open_system( 'MPC_SISO_0_block' )
mpc_out = sim( 'MPC_SISO_0_block' );
figure
title( 'Deterioration of the MPC' )
hold on
plot( mpc_out.ScopeData{1}.Values.Time,mpc_out.ScopeData{2}.Values.Data,'LineWidth',2 )
dm = 0.1;
for cnt = -3:3
dp = dm * cnt;
d_K0 = K0 * dp;
num_p = K0 + d_K0;
plant = tf( num_p, den_p );
open_system( 'MPC_SISO_0_block' )
mpc_out = sim( 'MPC_SISO_0_block' );
plot( mpc_out.ScopeData{1}.Values.Time,mpc_out.ScopeData{2}.Values.Data )
% plot( mpc_out.ScopeData{1}.Values.Time,mpc_out.ScopeData{2}.Values.Data*(1+cnt*0.1) )
end
legend
title( 'MPC K' )
hold off
これはスクリプトの一部ですが、このd_K0の値を凡例に入れ、例えばd_K0=1のとき、K=1と表示されるようにしたいです。
Accepted Answer
More Answers (0)
Categories
Find more on グラフィックス パフォーマンス in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!