Need help shrinking axis'

11 vues (au cours des 30 derniers jours)
Bobby Punjabi
Bobby Punjabi le 22 Sep 2017
Commenté : Rena Berman le 28 Sep 2017
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)
  1 commentaire
Rena Berman
Rena Berman le 28 Sep 2017
(Answers Dev) Restored edit

Connectez-vous pour commenter.

Réponses (2)

KL
KL le 22 Sep 2017

Star Strider
Star Strider le 22 Sep 2017
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')

Catégories

En savoir plus sur White dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by