How do I store a figure inside a variable?
3 views (last 30 days)
Show older comments
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]');
Answers (0)
See Also
Categories
Find more on Polar Plots 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!