Need help shrinking axis'

11 次查看(过去 30 天)
Bobby Punjabi
Bobby Punjabi 2017-9-22
Hey Guys!
I need help to shrink my axis so the y axis goes up by 0.2 and is limited at 2.0. It also needs to start at 0.4 (Being the (0,0) location). For example it will start at 0.4, then 0.6, then ..... and last 1.8
with the x axis I need the line to keep going towards 25 and not stop at 20. Thanks so much, I am not sure how to fix these up
i = 1;
width = 0.1;
depth = 0;
d= 0;
while width<20
a(i)=sqrt(1+400/(width(i).^2));
d(i)=(8.050*(width(i).^2)/40*(acosh(a(i))+a(i)*sinh(acosh(a(i))))*0.01*3*sqrt(5)/(width(i))).^(2/3);
width(i+1)= width(i)+0.1;
depth = d(i);
i = i+1;
end
ylabel('Depth of Immersed Ship(m)')
xlabel('Width of Ship(m)')
title('Depth of immersed ship vs ship width')
plot(width(2:end),d)

回答(2 个)

KL
KL 2017-9-22

Star Strider
Star Strider 2017-9-22
Try this:
i = 1;
width = 0.1;
depth = 0;
d= 0;
while width<20
a(i)=sqrt(1+400/(width(i).^2));
d(i)=(8.050*(width(i).^2)/40*(acosh(a(i))+a(i)*sinh(acosh(a(i))))*0.01*3*sqrt(5)/(width(i))).^(2/3);
width(i+1)= width(i)+0.1;
depth = d(i);
i = i+1;
end
figure(1)
plot(width(2:end),d)
axis([0 25 0.4 2.0])
set(gca, 'YTick', 0.4:0.2:2)
ylabel('Depth of Immersed Ship(m)')
xlabel('Width of Ship(m)')
title('Depth of immersed ship vs ship width')

类别

Help CenterFile Exchange 中查找有关 White 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by