You should be using graphics handles:
How do I store a figure inside a variable?
3 次查看(过去 30 天)
显示 更早的评论
I have my program creating and storing the figure data inside a variable however unlike other variables, when the program ends the values inside the created variable are cleared. If you reach the end by stepping through however, the values remain.
n.engine.powerCurveFig = figure;
title('Engine Power and Torque vs RPM');
xlabel('Engine Speed [RPM]');
xlim([n.engine.aRPM(1,1) n.engine.aRPM(n.engine.numStates,1)]);
set(gca,'xtick', (n.engine.aRPM(1,1):500:n.engine.aRPM(n.engine.numStates,1)));
grid on
yyaxis right
plot(n.engine.aRPM,n.engine.aTorque);
ylabel('Engine Torque [ft*lb]');
figure(n.engine.powerCurveFig);
yyaxis left
plot(n.engine.aRPM,n.engine.aPower);
ylabel('Engine Power [HP]');
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Polar Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!