Why doesn't Maple recognize matrix in list?

In summary: Maybe one is more basic than the other.In summary, the conversation involved a user trying to resolve a matrix in Maple using a list instead of entering numbers individually. They encountered some issues with loading packages and performing operations on the matrix. After some troubleshooting, the user was able to successfully perform the desired operations using the MTM package.
  • #1
flyingpig
2,579
1

Homework Statement



I am basically just trying to resolve this matrix in maple by using a list because for a big system, there is no way I am entering all the numbers one by one and only to find out later my size was wrong.

So for instance

A := matrix([[2,3,3,0],[3,1,4,9]])

Now for some reason, (and I already loaded the packages), once you hit enter, you cannot do anything to A

So for instance

Code:
>A^-1
>1/A
>Transpose(A)
>Transpose(A)

It returns my command.


Anyone got a clue? Also does anyone know how to set the default for 1-column matrices to MATRICES and NOT vectors? Getting tired of Maple's automatic switches
 
Physics news on Phys.org
  • #2
Install need the MTM package. Try this:

> restart; with(MTM);
> A := matrix([[2, 3, 3, 0], [3, 1, 4, 9]]);
> transpose(A);
> type(A, matrix);

Of course A-1 doesn't work since the matrix isn't square. And don't forget commands are case sensitive. No capital T on transpose.
 
  • #3
flyingpig said:

Homework Statement



I am basically just trying to resolve this matrix in maple by using a list because for a big system, there is no way I am entering all the numbers one by one and only to find out later my size was wrong.

So for instance

A := matrix([[2,3,3,0],[3,1,4,9]])

Now for some reason, (and I already loaded the packages), once you hit enter, you cannot do anything to A

So for instance

Code:
>A^-1
>1/A
>Transpose(A)
>Transpose(A)

It returns my command.


Anyone got a clue? Also does anyone know how to set the default for 1-column matrices to MATRICES and NOT vectors? Getting tired of Maple's automatic switches

I haven't used Maple for a very long time, but I'll take a stab at your questions, for what it's worth.

1. I don't know why you even tried to get A-1, since A is not a square matrix.
Even if A were a square matrix, you might have problems with A^-1. I would put parentheses around the exponent to see if that made a difference.

2. For Transpose(A), I'm going to guess that Maple is doing the calculation, but since you didn't tell Maple where to store the result, you don't see anything. I would try B = Transpose(A).
 
  • #4
LCKurtz said:
Install need the MTM package. Try this:

> restart; with(MTM);
Wow, I have never even seen that one before. Looked it up on Maple Help, still don't know what it is, but it works! By the way, what does "restart" do? Because I tried it without restart and it still worked
LCKurtz said:
No capital T on transpose.

No it worked when I loaded (the original) package with(LinearAlgebra) or Student Linear Algebra

Mark44 said:
2. For Transpose(A), I'm going to guess that Maple is doing the calculation, but since you didn't tell Maple where to store the result, you don't see anything. I would try B = Transpose(A).

1. I don't know why you even tried to get A-1, since A is not a square matrix.
Even if A were a square matrix, you might have problems with A^-1. I would put parentheses around the exponent to see if that made a difference.

I use Maple 15, they've managed to get across those problems storing factor thankfully.

And yes, I forgot that my matrix wasn't square, but even if it were square, it didn't work.

Here is the full code that I used originally

Code:
>with(LinearAlgebra):
>A := matrix([[2, 3, 3, 0], [3, 1, 4, 9]])
>Transpose(A)
>[color=pink]Error, (in LinearAlgebra:-Transpose) invalid input: LinearAlgebra:-Transpose expects its 1st argument, A, to be of type {Matrix, Vector, scalar} but received A[/color]

Pink was the error message returned to me

EDIT: for some reason transpose (lower case t) also works, but for a square matrix, B^-1 still doesn't work
 
  • #5
flyingpig said:
Wow, I have never even seen that one before. Looked it up on Maple Help, still don't know what it is, but it works! By the way, what does "restart" do?

Restart re-initializes the worksheet. It is handy when you have made a bunch of changes and want Maple to start over with brand new uncorrupted variables. I always put it at the top of a worksheet so when I tell Maple to re-execute the worksheet it begins with new variables.
 
  • #6
flyingpig said:
EDIT: for some reason transpose (lower case t) also works, but for a square matrix, B^-1 still doesn't work

Use inv(A) for the inverse.
 
  • #7
OKay I did this again today, but it's not working again.

I introduced

Code:
with(LinearAlgebra):
with(MTM):

And I listed out the matrix in

T0:= matrix([[...]])T1:=Pivot(MultiplyRow(T0,...,..)...,...)

EDIT; never mind, for some reason it worked with STUDENT Linear Algebra. I don't even know why they separate the two packages
 

Question 1: Why doesn't Maple recognize matrix in list?

There could be several reasons why Maple may not recognize a matrix in a list, such as incorrect formatting, missing brackets, or using the wrong commands. It is important to carefully check the syntax and use the appropriate commands to ensure that Maple recognizes the matrix as intended.

Question 2: How do I format a matrix in a list for Maple?

To format a matrix in a list for Maple, you can use the Matrix command and enclose the elements of the matrix in square brackets. For example, Matrix([[1,2,3],[4,5,6],[7,8,9]]) would create a 3x3 matrix in a list.

Question 3: Can I use other data types in a matrix list in Maple?

Yes, Maple allows for the use of various data types in a matrix list, such as integers, decimals, fractions, and even other matrices. However, it is important to use the appropriate commands and ensure the correct formatting to avoid errors.

Question 4: Why do I keep getting an error when trying to create a matrix list in Maple?

There could be a few reasons why you may be experiencing errors when trying to create a matrix list in Maple. Some common causes include incorrect syntax, missing brackets, or using the wrong commands. Double-check your input and make sure to follow the correct formatting guidelines.

Question 5: Are there any resources or tutorials available for creating matrix lists in Maple?

Yes, there are various resources and tutorials available online for creating matrix lists in Maple. You can refer to the Maple documentation, watch tutorial videos, or seek help from the Maple community forums for assistance. It may also be helpful to practice with simple examples to familiarize yourself with the syntax and commands.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
  • Calculus and Beyond Homework Help
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
4K
  • Calculus and Beyond Homework Help
Replies
8
Views
2K
  • Programming and Computer Science
Replies
2
Views
3K
  • Calculus and Beyond Homework Help
Replies
11
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
9K
  • Engineering and Comp Sci Homework Help
Replies
11
Views
9K
  • Programming and Computer Science
Replies
2
Views
2K
  • Calculus and Beyond Homework Help
Replies
8
Views
16K
Back
Top