12.07.2015 Views

Learning Guide Learning Guide

Learning Guide Learning Guide

Learning Guide Learning Guide

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

274 • Chapter 7: Input and Outputprogram. You can use the ExportMatrix command with the followingsyntax.ExportMatrix( "filename", data )Here, filename is the string containing the name of the file to whichExportMatrix writes the data, and data is a Matrix. Note that any list,vector, list of lists, or table-based matrix can be converted to a Matrix byusing the Matrix constructor. For more information, refer to ?Matrix.> L:=LinearAlgebra[RandomMatrix](5);⎡⎤−66 −65 20 −90 3055 5 −7 −21 62L :=⎢ 68 66 16 −56 −79⎥⎣ 26 −36 −34 −8 −71 ⎦13 −41 −62 −50 28> ExportMatrix("matrixdata.txt", L):If the data is a Vector or any object that can be converted to typeVector, then ExportVector can be used. Lists and table-based vectorscan be converted by using the Vector constructor. For more information,refer to ?Vector.> L := [ 3, 3.1415, -65, 0 ];L := [3, 3.1415, −65, 0]> V := Vector(L);V :=⎡⎢⎣33.1415−650⎤⎥⎦> ExportVector( "vectordata.txt", V ):You can extend these routines so that they write more complicateddata, such as complex numbers or symbolic expressions. For more information,refer to ?ExportMatrix and ?ExportVector.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!