too many output arguments, ploting loop function
Ältere Kommentare anzeigen
Hi, I need completely help. I want to plot kind of 3D function with loop based on following codes (it's cut off so I dont copied all)
So, basically I want to plot x,y,z (lifetime,efficiency,H2MSAeff) from the function H2MSA_conversion.m . That function hat the head
function [H2MSA_eff]=H2MSA_conversion(senslife,eta,msaprice).
But I got error message :
Error using H2MSA_conversion
Too many output arguments.
Error in H2MSAeff_basecase_plot (line 87)
[a,b]=H2MSA_conversion(lifetime(j),efficiency(i), msaprice);
The codes I use for ploting:
%sensitivity analysis
%lifetime and efficiency
lifetime=linspace(30,5,20);
efficiency=linspace(0.3,0.05,20);
l=length(lifetime);
e=length(efficiency);
H2MSAeff=zeros(l,e); %EMPHASIS
for i=1:e
for j=1:l
[a,b]=H2MSA_conversion(lifetime(j),efficiency(i), msaprice); %EMPHASIS
plot_H2MSA_conversion=[a,b];
H2MSAeff(i,j)=plot_H2MSA_conversion(key);
end
end
efficiency=efficiency*100;
[Lifetime,Efficiency,H2MSAeff]=griddata(lifetime,efficiency,H2MSAeff,linspace(min(lifetime),...
max(lifetime),100)',linspace(min(efficiency),max(efficiency),100),'linear');
if figurekey==1
Lmin=min(min(H2MSAeff));Lmax=max(max(H2MSAeff));
L=[Lmin,100,1000,10000,30000,40000,Lmax];
L=roundn(L,-1);
[C,h]=contourf(Lifetime,Efficiency,H2MSAeff,L,'ShowText','on','color','white');
clabel(C,h,'FontSize',13,'Color','w'); %Set curve label font size
colorbar;
colormap(parula);
xlabel('Lifetime(year)');
ylabel('STH Efficiency(%)');
m = get(gca,'XTickLabel'); % Set font size of axis
set(gca,'XTickLabel',m,'fontsize',13);
end
if figurekey~=1
end
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Programming finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!