[Top][All Lists]

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

Re: Permuted matrix is not a matrix?

From: James Sherman Jr.
Subject: Re: Permuted matrix is not a matrix?
Date: Sat, 13 Aug 2016 06:54:28 -0400

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

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.

reply via email to

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