Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

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

3 visualizaciones (últimos 30 días)
Pu Andaes
Pu Andaes el 13 de Sept. de 2020
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
I'm kind of new to MATLAB, how can I show the users' inputted data on a disp or fprintf function?
  4 comentarios
Walter Roberson
Walter Roberson el 14 de Sept. de 2020
disp() only accepts one parameter. But you can
disp(['Your answer is: ', num2str(ans)])

Respuestas (1)

KSSV
KSSV el 13 de Sept. de 2020
Editada: KSSV el 13 de Sept. de 2020
prompt = "Hey user, input a number: ";
num = input(prompt) ;
fprintf("User, you have entered %f\n",num)

La pregunta está cerrada.

Community Treasure Hunt

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

Start Hunting!

Translated by