MATLAB Answers

buxZED
0

program to get the user to enter the values

Asked by buxZED
on 24 Feb 2011
function y=mx+c
how can i write a program to get the user to enter the values for x and c and display the result for y

  0 Comments

Sign in to comment.

2 Answers

Answer by Davide Ferraro on 24 Feb 2011
 Accepted Answer

If you are expecting a command line input you can use the INPUT command:
A quick and nice graphic way is to use the function INPUTDLG:

  2 Comments

clear
clc
stu_id=0.2529;
prompt = {'Gravity (g):','Angle (a):','iv (V0):'};
dlg_title = 'Enter the values for';
num_lines = 1;
def = {'9.81','35','25.820880000000002'};
answer = inputdlg(prompt,dlg_title,num_lines,def);
how do i now use the user provided data?
See the separate question you posted on this.

Sign in to comment.


Answer by Walter Roberson
on 24 Feb 2011

Consider also questdlg()

  0 Comments

Sign in to comment.