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: textscan
Replies: 1   Last Post: Nov 27, 2012 12:19 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Tiger

Posts: 83
Registered: 6/22/12
textscan
Posted: Nov 27, 2012 11:53 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi all,

Suppose I have a text file as follows:
1 4 6 3 6,7
4 3 2 5 7,6
4 5 3 5 6,5

What "option" should I use in 'textscan' to be able to extract the last two numbers together as one variable. Many thanks in advance guys.

For the time being, here's my code:
fid = fopen('WF.txt');
linenum = 11;
a = textscan(fid, '%f %f %f %f %f', 1, 'delimiter', '', 'emptyvalue', 'headerlines', linenum-1);
J_ID = a{1};
T_ID = a{2};
Cores = a{3};
T_ET = a{4};
Deps = num2cell(a{5}); % Here's the problem, I'd like to have the last two numbers concatinated with a comma to equal 'Deps'. I'm not sure how. I tried EndOfLine, but it didn't work.
______________
Regards,
T


Date Subject Author
11/27/12
Read textscan
Tiger
11/27/12
Read Re: textscan
dpb

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

[Privacy Policy] [Terms of Use]

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