help-octave
[Top][All Lists]
Advanced

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

Re: Permuted matrix is not a matrix?


From: Maynard Wright
Subject: Re: Permuted matrix is not a matrix?
Date: Sat, 13 Aug 2016 07:45:50 -0700
User-agent: KMail/4.13.3 (Linux/3.16.0-30-generic; KDE/4.13.3; i686; ; )

On Saturday, August 13, 2016 06:54:28 AM James Sherman Jr. wrote:
> On Sat, Aug 13, 2016 at 6:06 AM, Vallet García José
> 
> <address@hidden> wrote:
> > Hello all.
> > 
> > Is this inconsistent?
> > --->
> > A=permute([1,2],[1 3 2]);
> > ismatrix(A)
> > ans = 0
> > typeinfo(A)
> > ans = matrix
> > <---
> > Why ismatrix returns 0 while typeinfo returns "matrix" as type? Am I
> > missing something?
> > 
> > BR,
> > J.
> > 
> > 
> > _______________________________________________
> > Help-octave mailing list
> > address@hidden
> > https://lists.gnu.org/mailman/listinfo/help-octave
> 
> The naming of "matrix" is a bit inconsistent, but as for why ismatrix
> returns a 0, from the help file:
> 
>  -- Built-in Function:  ismatrix (A)
>      Return true if A is a 2-D array.
> 
> And how you did the permute returns a matrix in 3 dimensions (not 2),
> thus ismatrix returns 0.  I would say that typeinfo (to be a bit more
> precise) should return "array", but I imagine that would break a lot
> of functions that use typeinfo to do checks on inputs.
> 
> Hope this helps,
> 
> James Sherman Jr.
> 
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/help-octave

In my installation of 3.8.1, ismatrix(A) returns ans = 1 and typeinfo(A) 
returns ans = matrix.


Maynard Wright





reply via email to

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