用于在gnuplot中绘制图形
我正在尝试将这个矩阵打印到一个文件中,但是要将它执行到gnuplot中,我需要创建一个没有逗号和括号的文件,我怎么做呢?
*install hmatrix
*install hmatrix-special
*import Numeric.LinearAlgebra
(5><2)
[ 0.12130139101653795, -3.9532277879855915e-2
, -9.943512129289413e-2, -1.8736674261187188e-2
, 0.21650870755682688, -7.774998273846949e-3
, -0.19540767578866855, -4.889335919164774e-2
, -4.296730149180415e-2, 0.11493730960653939 ]发布于 2016-06-25 02:47:39
这将打印出每一行都在自己的行上的矩阵:
{-# LANGUAGE NoMonomorphismRestriction #-}
import Numeric.LinearAlgebra
m :: Matrix Double
m = (5><2)
[ 0.12130139101653795, -3.9532277879855915e-2
, -9.943512129289413e-2, -1.8736674261187188e-2
, 0.21650870755682688, -7.774998273846949e-3
, -0.19540767578866855, -4.889335919164774e-2
, -4.296730149180415e-2, 0.11493730960653939 ]
printMatrix m = do
putStrLn $ unlines $ map (unwords . map show . toList ) (toRows m)
test = printMatrix mhttps://stackoverflow.com/questions/38021258
复制相似问题