필터 지우기
필터 지우기

program to get the user to enter the values

조회 수: 1 (최근 30일)
buxZED
buxZED 2011년 2월 24일
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

채택된 답변

Davide Ferraro
Davide Ferraro 2011년 2월 24일
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
buxZED
buxZED 2011년 2월 24일
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?
Walter Roberson
Walter Roberson 2011년 2월 24일
See the separate question you posted on this.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Walter Roberson
Walter Roberson 2011년 2월 24일
Consider also questdlg()

카테고리

Help CenterFile Exchange에서 Dialog Boxes에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by