Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Reading text file in a gui in matlab
Replies: 1   Last Post: Mar 11, 2013 10:44 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View  
dpb

Posts: 6,693
Registered: 6/7/07
Re: Reading text file in a gui in matlab
Posted: Mar 11, 2013 10:44 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 3/10/2013 12:36 AM, Harith M wrote:
> Hi friends,
> i need a help.i need to read an assembly program wriiten in a text
> file(notepad) into matlab as a whole.i tried fgets n fgetl.but only 1
> line is shown in static or edit text at a time.how can i display the
> whole text at a time?
>
> also can i show line by line by incorporatinf looping function?means can
> i know the sequencing of instructions even if there is a loop function?


You'll have to first be sure the file is saved as plain text w/o any
markup from Notepad...assuming to be true

fid=fopen('yourfile.txt','rt');
while ~feof(fid)
l=fgetl(fid)
disp(l)
end
fid=fclose(fid);

will echo the file to the screen--salt to suit your purposes.

I've not used any of the Matlab gui components but undoubtedly there's a
multi-line textbox of some sort available.

--




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2013. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.