Merge Three Figures Into One
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
This will generate 3 separate figures , how can I get it onto one figure ?
clear all;
clc;
hi=5.5*1e6; %heat input=5.5*10^(-6) Btu/h
time=4200; %time=4200 hours
cost=[4*1e-6,5*1e-6,6*1e-6]; %cost is per million Btu
eff1=0.7; %efficiency = 0.7
%tuning efficiency varying from 0.7 to 0.9
eff=linspace(0.7,0.9,10);
for i=1:3
j=1;
for eff2=linspace(0.7,0.9,10);
annual_energy(j)=hi*time*eff2;
cost_saving(j)=cost(i)*hi*time*(eff2-eff1);
j=j+1;
end
figure %opens new figure
[hAx,hLine1,hLine2]=plotyy(eff,annual_energy,eff,cost_saving);
xlabel('Efficiency');
ylabel(hAx(2),'Cost saving in $');
ylabel(hAx(1),'Annual Energy in Btu');
legend('Annual Energy','Cost Saving');
title(['Annual Energy and Cost Saving vs Efficiency at $',num2str(cost(i))]);
end
0 comentarios
Respuesta aceptada
VBBV
el 3 de Feb. de 2021
clear all;
clc;
hi=5.5*1e6; %heat input=5.5*10^(-6) Btu/h
time=4200; %time=4200 hours
cost=[4*1e-6,5*1e-6,6*1e-6]; %cost is per million Btu
eff1=0.7; %efficiency = 0.7
%tuning efficiency varying from 0.7 to 0.9
eff=linspace(0.7,0.9,10);
for i=1:3
j=1;
for eff2=linspace(0.7,0.9,10);
annual_energy(j)=hi*time*eff2;
cost_saving(j)=cost(i)*hi*time*(eff2-eff1);
j=j+1;
end
subplot(3,1,i)%figure %opens new figure
[hAx,hLine1,hLine2]=plotyy(eff,annual_energy,eff,cost_saving);
xlabel('Efficiency');
ylabel(hAx(2),'Cost saving in $');
ylabel(hAx(1),'Annual Energy in Btu');
legend('Annual Energy','Cost Saving');
title(['Annual Energy and Cost Saving vs Efficiency at $',num2str(cost(i))]);
end
2 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Graphics Objects en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!