Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: How can I perform Matrix comparison?Can any one with kindness help

  • To: mathgroup at smc.vnet.net
  • Subject: [mg114818] Re: How can I perform Matrix comparison?Can any one with kindness help
  • From: Jaebum Jung <jaebum at wolfram.com>
  • Date: Fri, 17 Dec 2010 23:49:14 -0500 (EST)

You could define a function like the following:

mGreater[a_, b_] := MatrixQ[MapThread[Greater, {a, b}, 2], TrueQ]

a = {{2, 3}, {4, 5}}; b = {{1, 2}, {2, 3}};

In[32]:= mGreater[a, b]

Out[32]= True

In[33]:= mGreater[b, a]

Out[33]= False

- Jaebum

----- Original Message -----
From: "fmingu" <fmingu at 163.com>
To: mathgroup at smc.vnet.net
Sent: Friday, December 17, 2010 2:29:11 AM
Subject: [mg114818] [mg114792] How can I perform Matrix comparison?Can any one with kindness help

I am using mathematica for practical purpose.
I wonder how can I perform Matrix comparison.
For instance:
a={{2,3},{4,5}}; b={{1,2},{2,3}};
a>b
I want the result is True.
But it seems that Mathematica can not recognize it.
I do not know how I can solve it? Are there any additional package to be added?
Can any one with kindness help me?


  • Prev by Date: Re: How can I perform Matrix comparison?Can any one with kindness help
  • Next by Date: Re: How can I perform Matrix comparison?Can any one with kindness help
  • Previous by thread: Re: How can I perform Matrix comparison?Can any one with kindness help
  • Next by thread: Re: How can I perform Matrix comparison?Can any one with kindness help