Simulink にマルチプレクサ ブロック Mux を含むスコープがあります (複数の wavaforms を 1 つのグラフに描画したい)。シミュレーションの後、定義された形式 (背景色、線幅など) で eps/pdf および png ファイルにエクスポートする必要があります。
実際の問題:
- 凡例の色が正しくありません。
私の夢:
- Simulink でシミュレーションを開始します (開始するには F5 をクリックします)。
- 次に、独自の関数 (スクリプト) を呼び出してエクスポートします (例: set_and_export(label x, label y, legend wave 1, legend wave 2, .. ,legend wave x) )
最終的な状態は、私の夢を実現することです。
私のmファイル:
% Get the data from Simulink
% First column is the time signal
% in Scope in Simulink : Array with time
[nothing, NumOfSgns] = size(ScopeData)
time = ScopeData(:,1);
% Plot all signals
hold on
for j=0:NumOfSgns-2,
graph=plot(time,ScopeData(:,2+j:end),'Color', rand(1,3));
% Signals description and position of the legend
legend('firs wave form','next wave form','Location','SouthEast');
end
hold off
ありがとうございました。