How to Fit Plot into Axes
Ältere Kommentare anzeigen
Hello, I'm very new to MatLab since I have exactly 2 days of using it. I began to get familiar doing and modifying some coding. Hoewever, I'm having trouble fitting a plot's output into the axes created at the GUI. I attach code and screenshot below) I wanna know how to make them fit in to the axes without the plot doing what it likes. Thank you very much in advance.

function pushbutton1_Callback(hObject, eventdata, handles)
sliderVal1=get(handles.Prslider,'Value');
Pr = [sliderVal1]; % Choose Prandtl
sliderVal2=get(handles.NusselSlider,'Value');
etaMax = [sliderVal2]; % Choose etaMax
sliderVal3=get(handles.lengthslider,'Value');
xm = [sliderVal3];
solinit = bvpinit(linspace(0,etaMax,8),...
[0, 0, 0, 0, 0]);
sol = bvp4c(@BlasiusT, @BlasiusTbc,...
solinit, [], Pr);
eta = linspace(0, etaMax);
y = deval(sol, eta);
subplot(2, 1, 1);
plot(eta, y(1,:),'--k',eta,y(2,:),'-k',eta,...
y(3,:),'Color',[0.9,0.1,0.1]);':k';
xlabel('\eta');
ylabel('y_1, y_2, y_3');
legend('Stream function f = y_1',...
'Velocity, df/d\eta = y_2', ...
'Shear, d^2f/d\eta^2 = y_3');
subplot(2, 1, 2);
plot(eta, y(4,:), '--k', eta, y(5,:), 'Color',[0,0.1,0.9]);':k';
axis([0 xm 0 2]);
legend('Temperature, T^* = y_4',...
'Heat flux, dT^*/d\eta = y_5');
xlabel('\eta');
ylabel('y_4, y_5');
Akzeptierte Antwort
Weitere Antworten (1)
Jose Treviño
am 25 Nov. 2015
0 Stimmen
Kategorien
Mehr zu Mathematics 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!