I'm trying to plot these points, please help?

x(10-110) increments of 1
y=(W*L)*(sqrt((h^2)+(x^2)))/(h*x) (for every x value between 10-110)
W=500
L=120
h=50
Everytime I tried plotting x and y not all the y values from the formula would show on the graph, along with there being no line to show the change of Y/X.

 채택된 답변

Kevin Phung
Kevin Phung 2019년 3월 20일
편집: Kevin Phung 2019년 3월 20일

0 개 추천

x=10:1:110;
W=500;
L=120;
h=50;
y=(W*L)*(sqrt((h^2)+(x.^2)))./(h.*x) ;
figure
plot(x,y)
things to note:
  • define the variables BEFORE evaluating them in an equation.
  • dot operator for element wise multiplication / division

댓글 수: 2

Thank you, really appericate it.
happy to help!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Programming에 대해 자세히 알아보기

태그

질문:

2019년 3월 20일

댓글:

2019년 3월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by