[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: reshape array failed on windows
From: |
Jaroslav Hajek |
Subject: |
Re: reshape array failed on windows |
Date: |
Tue, 8 Dec 2009 06:48:07 +0100 |
On Tue, Dec 8, 2009 at 4:32 AM, Junqian Gordon Xu <address@hidden> wrote:
> On 12/07/2009 07:45 PM, John W. Eaton wrote:
>> On 7-Dec-2009, Junqian Gordon Xu wrote:
>>
>> | Tested the same reshape function on Octave 3.2.3 on Debian/Linux, which
>> | worked fine.
>> |
>> | Maybe this is a regression of the reshape function compiled for windows.
>> |
>> | Gordon
>> |
>> | On 12/07/2009 07:27 PM, Junqian Xu wrote:
>> | > Octave 3.2.3 windows
>> | >
>> | > fid=fopen('file_name','r');
>> | > temp=fread(fid,Inf,'short');
>> | >
>> | > I can verify temp reads the integer values fine as in matlab. However
>> | > matlab is able to do
>> | >
>> | > reshape(temp,256,256)
>> | >
>> | > But in Octave, it returns an error of
>> | >
>> | > error: reshape: can't reshape 0x1 array to 256x256 array.
>> | >
>> | > Maybe I'm missing something very basic here.
>> | >
>> | > Gordon
>>
>> I expect that the problem is not with reshape. It looks like the size
>> of temp is 0x1, so I think the values were not read correctly from the
>> file.
>>
>> jwe
>>
>
> But the fopen and fread lines are exactly the same for linux and windows.
>
> Gordon
Have you checked that the file is opened correctly (fid != -1)?
You wrote:
"I can verify temp reads the integer values fine as in matlab."
How did you verify that? Do the values display correctly at that point?
--
RNDr. Jaroslav Hajek
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz