Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
How to print my result in EditText GUI

Subject: How to print my result in EditText GUI

From: roobi o

Date: 31 Oct, 2010 20:26:04

Message: 1 of 2

I have some results from my functions in my GUI program.
They must be displayed in Edittext.
but every time, previous one was deleted.
Is there any command like "fprintf"

fid1 = fopen('adjustmentresult.txt','wt'); % Create result file for adjustment
fprintf(fid1,'Number Of Stations : %d\n',ns);


 in GUI that I can see my result in EDitText and also save them in textfile????



function open_Callback(hObject, eventdata, handles)


[fileName, filePath] = uigetfile('*.txt','Select text file to open'); % path from the user
if fileName==0 % if it is canceled
    fileName=''; % create an empty name
    filePath=''; % create an empty path
end
fullname = [filePath fileName] % form a new name
set(handles.textopen,'String', fullname); % write in the editPath

readtxt(fileName); % This is my Function
global ns no na naz nd nfs df

set(handles.edit1,'String', ns); % write in the editPath
hold on
set(handles.edit1,'String', no); % write in the editPath
set(handles.edit1,'String', na); % write in the editPath
set(handles.edit1,'String', naz); % write in the editPath
set(handles.edit1,'String', df); % write in the editPath

Subject: How to print my result in EditText GUI

From: roobi o

Date: 2 Nov, 2010 06:37:04

Message: 2 of 2

I used another solution but still is not my answer

aaa = ['number of station ',int2str(ns),' number of observation', int2str(no)];
set(handles.edit1,'String', aaa)

Tags for this Thread

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.

Contact us