From: karan on
i want to load matrix from a file like this

MATRIX A1=# Sparse Matrix (Morse)
# first line: n m (is symmetic) nbcoef
# after for each nonzero coefficient: i j a_ij where (i,j) \in {1,...,n}x{1,...,m}
8 8 0 34
1 1 1.25
1 3 -1
1 4 -0.25
2 2 1.25
2 3 -1
2 6 -0.25
3 1 -1
3 2 -1
3 3 2.5
3 4 -0.25
3 6 -0.25
4 1 -0.25
4 3 -0.25
4 4 1.75
4 5 -0.25
4 6 -0.75000000000000022204
4 7 -0.25
5 4 -0.25
5 5 1.25
5 7 -1
6 2 -0.25
6 3 -0.25
6 4 -0.75000000000000022204
6 6 1.75
6 7 -0.25
6 8 -0.25
7 4 -0.25
7 5 -1
7 6 -0.25
7 7 2.5
7 8 -1
8 6 -0.25
8 7 -1
8 8 1.25

i can use load function if i delete first 4-5 lines because they contain text etc... is there any way to load the matrix without deleting these lines i mean some way i can ignore them
From: karan on
i am right now deleting first 4 lines
From: Jos (10584) on
karan <karan19882007(a)gmail.com> wrote in message <1142309036.309862.1276161193686.JavaMail.root(a)gallium.mathforum.org>...
> i want to load matrix from a file like this
* snip example*
> i can use load function if i delete first 4-5 lines because they contain text etc... is there any way to load the matrix without deleting these lines i mean some way i can ignore them

help importdata
help uiimport
help textscan

Jos
From: karan on
i saw something like mmread works exactly for this format...i dont know how to use it