Need help shrinking axis'

11 ビュー (過去 30 日間)
Bobby Punjabi
Bobby Punjabi 2017 年 9 月 22 日
コメント済み: Rena Berman 2017 年 9 月 28 日
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 件のコメント
Rena Berman
Rena Berman 2017 年 9 月 28 日
(Answers Dev) Restored edit

サインインしてコメントする。

回答 (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 Center および File ExchangeWhite についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by