On Sat, Apr 26, 2008 at 8:36 PM, Ronald Modesitt <rmodesi at msn.com> wrote:
> I am following sections 1.5.8 and 1.5.9. doline() creates fit1.dat in the
> wxMaxima root folder and printline("fit1.dat") displays exactly as does your
> text.
>
> In section 1.5.9 the command
>
> Datamatrix: read_matrix("fit1.dat")
>
> produces the following output (truncated here)
>
> matrix([<,mth,>,<,n,>,1,<,/,n,>,<,st,>,<,/,st,>,<,n,>,1.8,<,/,n,>,<,t,>=,<,/,t,>,<,n,>,2.0904,<,/,n,>,<,st,>,
> ? n,>,<,t,>=,<,/,t,>,<,n,>,11.329,<,/,n,>,<,st,>,<,/,st,>,<,/,mth,>])
Change the function doline to set option variable display2d to false:
doline():=block([x,y,r, display2d:false],
set_random_state (make_random_state (654321)),
with_stdout( "fit1.dat" , for i:1 thru 10 do (
x : i,
r: -0.2 + random(0.4),
y: 1 + x + r,
print(x,y)
) /* end do */
) /* end with_stdout */
)$
This will produce correct fit1.dat file which can be loaded with read_matrix.
HTH,
--
Andrej