Hi,
try Numeric.Container.loadMatrix.
Regards,
Philipp
On 15.06.2011 14:59, kaffeepause73 wrote:
Hey guys,
thanks for the very quick help. The code works and looks like:
(any tips regards speed and memory usage ?)
import System.IO
import Data.Array
import Data.Packed.Matrix
parse :: String
Hey guys,
thanks for the very quick help. The code works and looks like:
(any tips regards speed and memory usage ?)
import System.IO
import Data.Array
import Data.Packed.Matrix
parse :: String -> [[Double]] -- expects plainer syntax
parse = map (map read . words) . lines
main = do
--
Hey guys,
thanks for the very quick help. The code works and looks like:
(any tips regards speed and memory usage ?)
import System.IO
import Data.Array
import Data.Packed.Matrix
parse :: String -> [[Double]] -- expects plainer syntax
parse = map (map read . words) . lines
main = do
read :: String -> [[Double]] can't read this format. It expects
"[[0,30,9],[0.1,30,9],...]"
use this code
let m = map f text :: [[Double]]
f a = map g $ lines a
g a = map read $ words a
15.06.2011 15:13, kaffeepause73 пишет:
Dear all,
I want to read numeric data in vector / matrix f
On Wed, Jun 15, 2011 at 04:13:49AM -0700, kaffeepause73 wrote:
> The folloing file log.txt contains three signal traces in the three columns
> (time, signal 1, signal 2)
>
> 0 30 9
> 0.1 30 9
> 0.2 30 9
>
> let m = read text :: [[Double]]
>
> SecondLot
> signalImport: Prelude.read: no par
Hi,
On 15/06/11 12:13, kaffeepause73 wrote:
let m = read text :: [[Double]]
signalImport: Prelude.read: no parse
read :: String -> [[Double]] -- expects Haskell syntax
try something like:
parse :: String -> [[Double]] -- expects plainer syntax
parse = map (map read . words) . lines
C
Dear all,
I want to read numeric data in vector / matrix format generated by octave.
As I haven't seen any octave specific libraries yet (only matlab), I'm
tyrying the way via ascii - file.
The folloing file log.txt contains three signal traces in the three columns
(time, signal 1, signal 2)
0