SetDirectory["/home/faculty/struther/public_html/Courses/5903/SampleMatrices"]

Full5903MatrixExport[FileName_String,Matrix_]:=Module[
{FileHandle},
FileHandle=OpenWrite[FileName];
WriteString[FileHandle, "5903FullMatrix\n"];
{m,n}=Dimensions[Matrix];
WriteString[FileHandle,m,"\t",n, "\tfloat\n"];
WriteString[FileHandle,ExportString[Matrix,"TSV"]];
Close[FileHandle];
]

Sparse5903MatrixExport[FileName_String,SparseMatrix_,m_,n_]:=Module[
{FileHandle},
FileHandle=OpenWrite[FileName];
WriteString[FileHandle, "5903SparseMatrix\n"];
WriteString[FileHandle,m,"\t",n,"\tfloat\n"];
WriteString[FileHandle,ExportString[SparseMatrix,"TSV"]];
Close[FileHandle];
]

A= Table[
Random[Real,{-100,100}],
{10},{12}];
Full5903MatrixExport["FullATenBytwelve.ma5903",A]

Len=21;
{m,n}={10,10};
While[
SparseA=Sort[
 Table[
{Random[Integer,{0,m-1}],Random[Integer,{0,n-1}],Random[]},
{Len}]
];
Union[SparseA[[All,{1,2}]]]≠Len,
Null
];
Sparse5903MatrixExport["SparseATenBytwelve.ma5903",SparseA,m,n]

Making a 100 by 100 sample matrix

Len=45;
{m,n}={100,100};
While[
SparseA=Sort[
 Table[
{Random[Integer,{0,m-1}],Random[Integer,{0,n-1}],Random[]},
{Len}]
];
Fred=DeleteCases[Union[SparseA[[All,{1,2}]]],{_i,_i}];
Length[Fred]≠Len,
Null
];

SparseA = Union[
SparseA,
Table[ {i,i,10+Random[Real, {0,1}]},{i,1,m}]
];

b = {Table[Random[Real,{0,1}],{m}]};

ExportString[SparseA,"TSV"]

Sparse5903MatrixExport["ASparseSqHundred.ma5903",SparseA,m,n];

Full5903MatrixExport["bHundred.ma5903",b]