On 6/29/2012 3:09 PM, Steven wrote:
...
> It looks to me like textscan and textread follow exactly the same
> format, so can someone help me understand why this code works with
> textread but not with textscan? I'm trying to update this code and, as
> the documentation for textread suggests, use textscan instead of textread.
The documentation also notes that textscan() returns a cell array of the
dimension of the number of conversion specifiers whereas textread()
returns a separate variable/array for each format field.
So, not only will you have to change to return the values in a cell
you'll then have to either recode to use the cell contents or convert
the cell contents to the existing variables to make the conversion.
What a forced waste of time for no real gain... :(
Why TMW is choosing to actually remove textread() is beyond my ken; at
least w/o replacing it w/ something that is similarly convenient when
one wishes to have individual variables. It's possible to convert from
the cell array to variables of course but it's just another step that
one has choice in using at present. Not to mention the breaking of old
code is just a bad thing to happen unless it is truly mandatory and
there seems no reason other than convenience that it should be that
necessary to remove textread().
I don't see anything wrong w/ introducing textscan(), certainly;
textread() has some warts that textscan improves upon but "the only way
is my way" as far as returning the cell is a club, certainly.
Just my $0.02333, imo, ymmv, etc., etc, etc., ...
--