Thread Subject:
edit text field in GUI, read out from excel data file

Subject: edit text field in GUI, read out from excel data file

From: Markus

Date: 12 Apr, 2012 09:59:18

Message: 1 of 2

Dear Mathlabs,

I don't know why it has to be always the simple stuff that is not working with me ;-)
I am a newbie, I admit!

I simply want to have the respective values of a certain row of an excel sheet displayed in an edit-text field "2" in my GUI. The specialty is, the respective value is to be grabbed from another edit-text field "1" of the GUI! (2 edit-texts, the second should get the value from the first one in which row to look at in the excel file)
Here we go:

function edittextfield2_Callback ........
T=xlsread('excel', 'sheet, 'range'); %T is a 1000x1 matrix
M=get(handles.edittextfield1, 'Value'); %is edittextfield1 to be made global??
N=T(M,:);
set(handles.edittextfield2, 'String', num2str(N));

I don't know, why my edittextfield2 stays at its initial value "0" all the time.. ?!!?

Thanks a lot for help! Cheers, Markus

Subject: edit text field in GUI, read out from excel data file

From: John Smith

Date: 26 Apr, 2012 13:59:07

Message: 2 of 2

"Markus" wrote in message <jm691m$hd8$1@newscl01ah.mathworks.com>...
> Dear Mathlabs,
>
> I don't know why it has to be always the simple stuff that is not working with me ;-)
> I am a newbie, I admit!
>
> I simply want to have the respective values of a certain row of an excel sheet displayed in an edit-text field "2" in my GUI. The specialty is, the respective value is to be grabbed from another edit-text field "1" of the GUI! (2 edit-texts, the second should get the value from the first one in which row to look at in the excel file)
> Here we go:
>
> function edittextfield2_Callback ........
> T=xlsread('excel', 'sheet, 'range'); %T is a 1000x1 matrix
> M=get(handles.edittextfield1, 'Value'); %is edittextfield1 to be made global??
> N=T(M,:);
> set(handles.edittextfield2, 'String', num2str(N));
>
> I don't know, why my edittextfield2 stays at its initial value "0" all the time.. ?!!?
>
> Thanks a lot for help! Cheers, Markus

To get the number in your first edit text, you have to do:
M = str2num(get(handles.edittextfield1,'String');

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
gui Markus 12 Apr, 2012 05:59:25
edit text field Markus 12 Apr, 2012 05:59:25
read out Markus 12 Apr, 2012 05:59:25
set Markus 12 Apr, 2012 05:59:25
get Markus 12 Apr, 2012 05:59:25
handles Markus 12 Apr, 2012 05:59:25
hobject Markus 12 Apr, 2012 05:59:25
rssFeed for this Thread

Contact us