| |
 |
|
|
Science Forum Index » Math - Symbolic Forum » Reading with Matlab a matrix created by Maple
Page 1 of 1
|
| Author |
Message |
| Kerem |
Posted: Mon May 07, 2007 1:07 pm |
|
|
|
Guest
|
Hello,
I am trying to read a matrix created by Maple (Maple 10) with Matlab
(Matlab 7.3). When I save the matrix as a .dat file for example, there
are multiple lines in this .dat file and some of the lines end with
the symbol "\" to indicate that they are continued in the next line.
However Matlab does not understand "\" and it does not accept a
"return" after each line unless it is accompanied with a "..." . An
example of the Maple saved output is as follows:
maplematrix_a := Matrix(7, 7, [[36,-39,38,-51,19,34,19],
[-12,-96,-90,-84,-92,
28,0],[81,-57,-72,-29,-67,47,54],[-6,45,62,-76,-93,9,-27],
[-57,27,-1,-20,-92,-\
70,96],[-91,96,-73,78,50,-42,57],[-2,-19,6,-38,34,12,-67]]);
Do you know any method (or command) I can save the matrix that I
created in Maple so that I can read it with Matlab? Thank you in
advance for your help,
Kerem Uguz |
|
|
| Back to top |
|
| Robert Israel |
Posted: Mon May 07, 2007 4:50 pm |
|
|
|
Guest
|
Kerem <uguz@ufl.edu> writes:
Quote: Hello,
I am trying to read a matrix created by Maple (Maple 10) with Matlab
(Matlab 7.3). When I save the matrix as a .dat file for example, there
are multiple lines in this .dat file and some of the lines end with
the symbol "\" to indicate that they are continued in the next line.
However Matlab does not understand "\" and it does not accept a
"return" after each line unless it is accompanied with a "..." . An
example of the Maple saved output is as follows:
maplematrix_a := Matrix(7, 7, [[36,-39,38,-51,19,34,19],
[-12,-96,-90,-84,-92,
28,0],[81,-57,-72,-29,-67,47,54],[-6,45,62,-76,-93,9,-27],
[-57,27,-1,-20,-92,-\
70,96],[-91,96,-73,78,50,-42,57],[-2,-19,6,-38,34,12,-67]]);
Do you know any method (or command) I can save the matrix that I
created in Maple so that I can read it with Matlab? Thank you in
advance for your help,
Try the ExportMatrix command, which can save a Matrix in Matlab
format. For example:
Quote: ExportMatrix("c:/temp/foo.mat", a, target=Matlab, format=rectangular);
The resulting file should be readable by Matlab.
--
Robert Israel israel@math.MyUniversitysInitials.ca
Department of Mathematics http://www.math.ubc.ca/~israel
University of British Columbia Vancouver, BC, Canada |
|
|
| Back to top |
|
| |
|
Page 1 of 1
All times are GMT - 5 Hours
The time now is Fri Aug 29, 2008 11:15 pm
|
|