1
g_wPWMOut=[g_wPWMOut0 g_wPWMOut1 g_wPWMOut2 g_wPWMOut3 g_wPWMOut4 ...
g_wPWMOut5 g_wPWMOut6 g_wPWMOut7];
figure
for i=0:1:7;
subplot(421+i)
plot(FCCTime, g_wPWMOut(:,(1+i)))
grid on
legend('Motor1+i')
ymax = max(g_wPWMOut(:,(1+i)));
ymin = min(g_wPWMOut(:,(1+i)));
xmax = max(FCCTime);
xmin = min(FCCTime);
axis([xmin-((xmax-xmin)*0.05) xmax+((xmax-xmin)*0.05) ...
ymin-((ymax-ymin)*0.05) ymax+((ymax-ymin)*0.05)])
end
こんにちは。私はmatlabについての助けが必要です 私はforループを使ってmfileを作ろうとしています。私はsubplot(4x2) と私は各グラフに凡例の関数を使用しようとしたい しかし、私は問題に直面した。私は各グラフが凡例( 'Motor1 + i')を使って凡例名を持つことを意図しています。すべてのグラフは同じ名前 'Motor1 + i'を持ちます。 Motor1、motor2、motor3、.......を作成したい この問題を解決するにはどうすればよいですか?私はforループを使用したMATLABサブプロットおよび各グラフの凡例