Need help shrinking axis'
조회 수: 13 (최근 30일)
이전 댓글 표시
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개)
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')
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 White에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!