Matlab GUI displaying output based on user input

조회 수: 1 (최근 30일)
Dimple
Dimple 2013년 8월 19일
i want to create one gui with two prompt messages 1. enter semester - I marks 2. enter semester - II marks
After entering marks & pressing OK button . it has to verify one excel file (having three columns of data). When the input data matches with the A column and B column values in excel file then the output is the corresponding C Column value. Display the output of C column's value.
any one help me to write the code for this

채택된 답변

David Sanchez
David Sanchez 2013년 8월 20일
M = xlsread('my_file.xls'); % matrix with data
x=find(M(:,1) == in_1); % in_1 is your first input
y=find(M(:,2) == in_2); % in_1 is your second input
c=find(x==y); % c returns where x==in_1 and y ==in_2
output = M(x(c),3);
  댓글 수: 3
Dimple
Dimple 2013년 8월 20일
Anyone pls give me a solution
David Sanchez
David Sanchez 2013년 8월 20일
In your case:
in_1 = str2num(ans{1});
in_2 = str2num(ans{2});
M = a;

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

추가 답변 (1개)

Dimple
Dimple 2013년 8월 20일
Any one pls. answer for this question

카테고리

Help CenterFile Exchange에서 Data Import from MATLAB에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by