The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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 ]

Posts: 83
Registered: 6/22/12
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.

Date Subject Author
Read textscan
Read Re: textscan

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

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.