Adept Scientific - English
The world's best software for research, science and engineering.
flag arrow
clearclear
 

 Adept Store | register Join My Adept | Flags  
Adept Scientific | Amor Way | Letchworth Garden City | Herts | SG6 1ZA | Tel: +44 (0)1462 480055  
UKusdedksvnofi
Home
Products
Training
Consultancy
 Buy Online
Downloads
Education
Support
My Adept
International |  About Us |  Contact Us |  Press Room |  Jobs


The Next Steps

• Ask us a question
• Maple Product Tour
• Buy Maple Now
• View Maple Pricing
• Find out about Online Training
• Download a Brochure
• Request a Brochure
• Download a Demo
• Request a Demo
• Meet Our Team
• Read our RSS Feeds

Learn More

Maple Home
Maple 11 Professional
Maple 11 Academic
Maple 11 Student Use
Recorded Online Seminars
FREE Training Resources


MapleNet
Maple T.A.
MapleConnect
BlockImporter for Simulink
BlockBuilder for Simulink
Maple Toolboxes
Maple Rave Reviews
Maple Study Guides
Books about Maple
System Requirements

View Maple 10 in Action
Product Comparison Chart

Latest Information

New Features: Professional
New Features: Academic
The Maple Reporter
The Maple Reporter Online
Numerical Algorithms Group
(NAG)


Service & Support

Maple 10 Training Videos
MaplePrimes, blogs, forums
Elite Maintenance Program
Application Centre
Powertools
Maple User Group (MUG)
Join the Maple User Group
(MUG)

Search the Knowledge Base
Technical Support request

List Archives >  Maple User Group List Archive >  Archive by date >  This Month By Date >  This Month By Topic

[MUG] convert question

Search email archive for  

[MUG] convert question
Author: Carl Eberhart    Posted: Sun, 13 Oct 2002 11:34:29 -0400

>> From: Carl Eberhart "carl"

Converting between matrices, lists, vectors and Matrices, Vectors
works well. But converting from a list to a matrix (in Maple 8 and
Maple 7) returns an error

convert([2,1,3],matrix);
Error, (in convert/matrix) expecting array, rtable or list

It would be convenient if Maple would return matrix([[1,2,3]])

Carl Eberhart, Mathematics 859-257-1258
University of Kentucky 759 POT
Lexington, Ky 40506
http://www.msc.uky.edu/carl

[MUG] Re: convert question
Author: Maple User Group    Posted: Fri, 18 Oct 2002 17:35:12 -0400

>> From: Maple User Group "maple_gr"

| >> From: Carl Eberhart "carl"
| Converting between matrices, lists, vectors and Matrices, Vectors
| works well. But converting from a list to a matrix (in Maple 8 and
| Maple 7) returns an error
|
| convert([2,1,3],matrix);
| Error, (in convert/matrix) expecting array, rtable or list
|
| It would be convenient if Maple would return matrix([[1,2,3]])

-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-

Date: Tue, 15 Oct 2002 15:37:41 -0700 (PDT)
From: Robert Israel "israel"
To: "maple-list"
Subject: convert question


But maybe it should be matrix([[1],[2],[3]]). How is Maple to know
if you want your list interpreted as a row or as a column?

BTW, convert([2,1,3],Matrix) does work (and results in a row).

Robert Israel "israel"
Department of Mathematics http://www.math.ubc.ca/~israel
University of British Columbia
Vancouver, BC, Canada V6T 1Z2



-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-

Date: Tue, 15 Oct 2002 22:01:12 -0400
From: "Douglas B. Meade" "meade"
To: "maple-list"
Subject: convert question

Carl and MUG,

The problem, of course, is that Maple does not know the
dimension of the matrix that you want it to create.

One possible workaround is to convert to a vector, then
convert the vector to a matrix. This returns a COLUMN
matrix, not a row matrix. If you really want a row matrix,
use transpose:

> L := [1,2,3];

L := [1, 2, 3]

> Lv := convert(L,vector);

Lv := [1, 2, 3]

> Lm := convert( L, matrix );
Error, (in convert/matrix) expecting array, rtable or list

> Lvm := convert( Lv, matrix );

[1]
[ ]
Lvm := [2]
[ ]
[3]

> Lm_row := linalg[transpose]( convert( convert( L, vector ), matrix )
> );

Lm_row := [1 2 3]

This last result could be taught to convert so that convert(
L, matrix ) would do this. Or, you could write your own
convert procedure:

> convertLtoM := (L::list) ->
> linalg[transpose](convert(convert(L,vector),matrix)):
> convertLtoM( L );

[1 2 3]

I hope this is of some use to you,

Doug
-----------------------------------------------------------------------
Douglas B. Meade Phone: (803) 777-6183 FAX:
(803) 777-6527
Department of Mathematics URL:
http://www.math.sc.edu/~meade/
USC, Columbia, SC 29208 E-mail: "mailto:meade"


-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-

From: "Peter Weigand" "peter.weigand"
To: "maple-list"
Date: Wed, 16 Oct 2002 10:27:54 +0200
Subject: convert question

The conversion is possible in two steps
convert([2,1,3], array):convert(%,matrix):

The result is a 3x1 column.

With regards
Peter Weigand-----------------------------------------------------
Dr. Peter Weigand,
Chemnitz University of Technology
Faculty of Mathematics
Mail :D-09107 Chemnitz, Germany
Phone: +49 0371 531 2655
Fax : +49 0371 531 4947
E-mail: "weigand"
_____________________________________________________



-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-

Date: Thu, 17 Oct 2002 09:37:21 +0100
Subject: convert question
To: "maple-list"
From: John Trapp "j.j.trapp"

Try
>convert(
[
>[2,1,3]
]
>,matrix);
or
>convert(
[
>[2
]
>,
[
>1
]
>,
[
>3
]
>],matrix);

Maple does not know whether you require a 1x3 or 3x1 matrix.

John Trapp



-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-

Date: Thu, 17 Oct 2002 10:00:45 -0400 (EDT)
From: Carl Devore "devore"
To: "maple-list"
Subject: convert question


But what if it would be convenient for someone else if it returned
matrix([[1],[2],[3]])? If L is a list, what is so bad about saying
matrix([L]) or convert([L], matrix) to get what you want? Also Maple 8
allows
convert(L, compose, Matrix, matrix)
and
`<|>`(L[])
returns a 1 x n Matrix (not matrix).

[MUG] Re: convert question
Author: Carl Eberhart    Posted: Mon, 21 Oct 2002 21:35:29 -0400

>> From: Carl Eberhart "carl"

Thanks for all the suggestions.
I wasn't being clear with my complaint.
The command convert([1,2,3],matrix) returns the error
expecting array, rtable or list
But [1,2,3] is a list.
I would be happy for maple to assume that I wanted a row matrix,
otherwise I would have asked it to convert([[1],[2],[3]],matrix)
But at least don't return that particular error message.
Carl

Carl Eberhart, Mathematics 859-257-1258
University of Kentucky 759 POT
Lexington, Ky 40506
http://www.msc.uky.edu/carl

Previous by date: [MUG] Simplex Bug (?), PierLuigi Zezza
Next by date: [MUG] Re: solving numerically, Robert Israel
Previous thread: [MUG] Problem with inequal, Dean Bernsten
Next thread: [MUG] Re: solving numerically, Robert Israel



Ready to buy?

Maple - single user licence
Add to shopping basket
$ 1,895.00
Upgrade to Maple 12 from v11
Add to shopping basket
$ 995.00
Upgrade to Maple 12 from v10 & below
Add to shopping basket
$ 1,395.00

Featured Downloads

What's New in Maple 11 for Professionals
Maple White Paper: Technical Knowledge - An Asset You Can Afford to Lose?
Maple in Electronics Application Pack
Maple in Robotics & Aerospace Application Pack
Maple in Finance Application Pack

Product Reviews

"Without the Maple software, we would have to spend weeks generating the equations of motion for every experiment. Then the chances that we did it right would basically be near zero. There would always be a mistake somewhere. It is very difficult to set up a dynamic motion model by hand."
- Jean-Claude PiedBeouf, Ph.D Manager of Robotics, Canadian Space Agency

"Its very good - highly accurate and easy to use. The speed of Maple allows me to change equations and quickly reintegrate them into the application, so more possibilities can be explored to achieve the precise effect desired."
Shawn Neely, Senior R & D Director for PDI/Dreamworks
adept

Top of the Page

Our Privacy and Terms and Conditions Statement
All Trademarks Recognised. Copyright © 2007, Adept Scientific plc.
Site designed and maintained by Adeptise

Adept Scientific | Amor Way | Letchworth Garden City | Herts | SG6 1ZA | Tel: +44 (0)1462 480055