Matlab GUI question

Thread Starter

Ron_7

Joined Dec 18, 2006
8
hello guys,

just wondering if anyone knows how to output the contents of a .dat or .txt file into a text box in a matlab gui.

i've used the following to create a .dat or .txt file.

fiw = fopen('watermarks.txt','wt');
fprintf(fiw,'\n watermark # %d = %s position = %d',kk,str,POSITION(kk));

i'm currently outputing to the command window using :

disp(sprintf(' watermark # %d = %s position = %d',kk,str,POSITION(kk)));

Thanks in advance

Ron
 

Dave

Joined Nov 17, 2003
6,969
If the text you wish to write to the text box is in String format then just set the handles for that textbox. For example:

If you have a textbox called textbox, and the String that you wish to write to it is in the variable var, then to write the String to the text box you would write:

set(handles.textbox,'String'
,var);

When the function to create/update the textbox/GUI is called the text will be written to the textbox.

Dave
 

Thread Starter

Ron_7

Joined Dec 18, 2006
8
If the text you wish to write to the text box is in String format then just set the handles for that textbox. For example:

If you have a textbox called textbox, and the String that you wish to write to it is in the variable var, then to write the String to the text box you would write:

set(handles.textbox,'String'
,var);

When the function to create/update the textbox/GUI is called the text will be written to the textbox.

Dave
Many Thanks Dave ur a star. This has done the trick!
 
Top