[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Q: matlab-like load for ascii files?
From: |
Francesco Potorti` |
Subject: |
Q: matlab-like load for ascii files? |
Date: |
Wed, 03 May 1995 18:33 +0100 (MET) |
Does someone have a modified version of the "load" command that can
read straight matrices from ascii-files, that is, for which no header
like e.g.
# name: x
# type: matrix
# rows: 10
# columns: 2
is necessary? Any help is welcome, thank you in advance.
This is not an answer, rather a workaround. This is a script I wrote
for adding headers to column vectors:
-------------------------octavehead----------------
if [ $# != 2 ]
then echo usage: $0 file varname
exit 1
fi
if [ ! -w $1 ]
then echo $0: cannot write file $1
exit 2
fi
set -e
tmpf=octh$$
mv $1 $tmpf
echo \# name: $2 >> $1
echo \# type: matrix >> $1
echo \# rows: `wc -l $tmpf` >> $1
echo \# columns: 1 >> $1
cat $tmpf >> $1
rm $tmpf
-----------------------------------------------------------