help with this question

The magnitude of the force, in Newtons (N), of a spring with a spring constant k stretched a distance x, is given by F = k x, while the elastic energy stored in the spring, in Joules (J), is given by U = k x2 / 2. Write a program that requests the user to enter the value of k and the minimum, xmin , and maximum, xmax , value of x and then prints the force and potential energy, every ( xmax - xmin ) / 100. Make sure that the units are also printed.

댓글 수: 4

Matt Fig
Matt Fig 2012년 12월 12일
Where are you stuck on your homework assignment?
Arthur
Arthur 2012년 12월 12일
If you solved a numeric question like this, try to change the values to variables and write it on a paper. And step by step, write on matlab language.
bob  shot
bob shot 2012년 12월 12일
if you guys could show me how i could start im really a beginner with writing programs with matlab. my professor challenged me to use matlab instead of the program that im used to using which is C++.
can you guys help

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

답변 (1개)

Image Analyst
Image Analyst 2012년 12월 12일

0 개 추천

Try inputdlg() - there are examples in the help. For the rest, MATLAB is remarkably like C so you should have no problems.

댓글 수: 1

Sean de Wolski
Sean de Wolski 2012년 12월 12일
Or you could just write it in C within the MEX header constructs and call that :)

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

카테고리

질문:

2012년 12월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by