prompt for variables in an equation
Ältere Kommentare anzeigen
Hello,
I am new here and to Matlab so here is my question. How do I promp a user for variables in an equation and after the answer is given to loop back again in order to enter new variable?
example:
promp for r
promp for h
r^2*acos((r-h)/r)-(r-h) * sqrt(2*r*h-h^2)
answer =
Loop
Akzeptierte Antwort
Weitere Antworten (1)
Panagiotis Panos Katranitsas
am 25 Feb. 2012
Hi Ken,
i think the instruction input is what you need.
ex.
reply = input('Do you want more? Y/N [Y]: ', 's');
if isempty(reply)
reply = 'Y';
end
3 Kommentare
Ken
am 25 Feb. 2012
Walter Roberson
am 26 Feb. 2012
At the point you have written "promp for r" and "promp for h"
Walter Roberson
am 26 Feb. 2012
Please do not send clarifying questions in email: post them as comments.
Kategorien
Mehr zu Logical finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!