help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: %x not working in textscan


From: Tony Richardson
Subject: Re: %x not working in textscan
Date: Sun, 19 Apr 2020 12:07:48 -0500

On Sun, Apr 19, 2020 at 11:07 AM dev1990 <address@hidden> wrote:
Hello all,

 i am running Octave 5.2 in Windows 10. I have found that %x as a conversion
specifier has not yet been implemented. Check textscan help also.  Below are
my snippet :


>> fid=fopen('sample.txt');
>> A=textscan(fid,'%x');
error: textscan: '%x' is not a valid format specifier
>> A=textscan(fid,'%s');
>> A
A =
{
  [1,1] =
  {
    [1,1] = 0x004de2ea
    [2,1] = 0x006df1f4
  }

}

>> fclose(fid)
ans = 0




--
Sent from: https://octave.1599824.n4.nabble.com/Octave-General-f1599825.html

I'm not sure if you are looking for an alternate method or are just asking for this to be implemented in textscan, 
but another way to read the numbers in would be to use fscanf:

A = fscanf(fid, '%x');

This would read the numbers into a matrix instead of a cell array.

Tony

reply via email to

[Prev in Thread] Current Thread [Next in Thread]