I have a program that will ask a no. of teg value 1 - 4. then input hotside value. coldside value.....and seebeck coefficient.
my problem is I don't know how to code it using gui. that if he put 2 in teg value the program will ask 2 time of hotside value and cold side value... seebeck coefficient.
If ( a = 1 )
str2num(get(handles.th,'String'))
%put it into box 1
str2num(get(handles.tc,'String'))
%put it into box 2
elseif (a = 2 )
str2num(get(handles.th,'String'))
%put it into box 1
str2num(get(handles.tc,'String'))
%put it into box 2
str2num(get(handles.th,'String'))
%put it into box 3
str2num(get(handles.tc,'String'))
%put it into box 4
end
I don't know if I'm going to use array or what?

댓글 수: 3

Geoff Hayes
Geoff Hayes 2016년 3월 21일
EJ - yes, if you are expecting the user to input multiple values for the same field (because there is more than one TEG), then you would need to use an array or a table.
From your pseudocode above, what is a? How are you expecting the user to input the heat side, cool side, etc. if there is more than one TEG?
EJ Ardiente
EJ Ardiente 2016년 3월 21일
@Geoff Hayes, a is the number of TEG inputted by the user. can you teach me how to make array in a certain function?
Geoff Hayes
Geoff Hayes 2016년 3월 23일
EJ - if the user enters a value of a that is greater than one, then how do you expect the user to enter the different values for heat side, cool side, etc. especially as your GUI only allows single value inputs for each? Or do you expect the user to enter a comma-separated list in each field?

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

답변 (0개)

카테고리

도움말 센터File Exchange에서 Structures에 대해 자세히 알아보기

질문:

2016년 3월 21일

댓글:

2016년 3월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by