Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

How do I show the variables the users' inputted in a disp or fprintf fucntion?

2 Ansichten (letzte 30 Tage)
Pu Andaes
Pu Andaes am 13 Sep. 2020
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
I'm kind of new to MATLAB, how can I show the users' inputted data on a disp or fprintf function?
  4 Kommentare
Walter Roberson
Walter Roberson am 14 Sep. 2020
disp() only accepts one parameter. But you can
disp(['Your answer is: ', num2str(ans)])

Antworten (1)

KSSV
KSSV am 13 Sep. 2020
Bearbeitet: KSSV am 13 Sep. 2020
prompt = "Hey user, input a number: ";
num = input(prompt) ;
fprintf("User, you have entered %f\n",num)

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by