help-octave
[Top][All Lists]
Advanced

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

Re: Save a 1x1 matrix


From: Jaroslav Hajek
Subject: Re: Save a 1x1 matrix
Date: Tue, 3 Aug 2010 09:06:07 +0200

On Mon, Aug 2, 2010 at 11:32 PM, Paolo Piacentini
<address@hidden> wrote:
>>> Do you want to load the file into another program?
>
> Exactly. I need to assure that another parser finds S(1,1) as matrix type.
> Hence, I would need Octave to save S(1,N) always as matrix even when N=1.
>
> Regards.
>

Basically, there is no "normal" way. Octave always stores the internal
type directly, so a scalar is a scalar and is stored as a scalar, even
though it behaves as 1x1 matrix in virtually all contexts. 1x1
matrices are normally immediately converted to scalars.

You can write your own C++ DLD function to achieve this, if it's really needed.

-- 
RNDr. Jaroslav Hajek, PhD
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz


reply via email to

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