Effacer les filtres
Effacer les filtres

help with this question

1 vue (au cours des 30 derniers jours)
bob  shot
bob shot le 12 Déc 2012
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 commentaires
bob  shot
bob shot le 12 Déc 2012
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

Connectez-vous pour commenter.

Réponses (1)

Image Analyst
Image Analyst le 12 Déc 2012
Try inputdlg() - there are examples in the help. For the rest, MATLAB is remarkably like C so you should have no problems.
  1 commentaire
Sean de Wolski
Sean de Wolski le 12 Déc 2012
Or you could just write it in C within the MEX header constructs and call that :)

Connectez-vous pour commenter.

Catégories

En savoir plus sur Programming 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