Items tagged with writedata writedata Tagged Items Feed

Dear All,

I would like to know the easiest way to write data, that are stored in a matrix after a computation, to a file with a specific format. To be more precise, I wish to have the possibility to change the format for a given column.

Here is a trial (output is wrote to the terminal for simplification) based on some examples I found, but without success.

WritedataMatrix.mw

writting data file

January 17 2012 by goli 125 Maple

Dear all

I made an array as

> T := Array(1..x, 1..6);

 where x = 1,000,000:

and then I wrote a loop for and after that I wanted to write the results as

> writedata("D:\\data\\test.txt", convert(T,array), float);

but I got an error as

> Error(in convert/list) object too large

What should I do now? It took more than 24 hours to run my program and I need the results as a text file. Please help me.

I think I have found a subtle bug in my Maple 9.

If I execute the following code:

###
 B:=[ 3.5, 0.0001, 73.45]; A:=[[seq(1/op(j,B), j=1..3)]];
 writedata("a.txt",A);
###

the output file a.txt contains the line
0.2857142857    1       0.01361470388
(beware: maple has written "1" instead than "10000"!)

Questions:
1) is this bug already known? Is there a patch?
2) does it affect newer versions of Maple?

have a list of lists, and I would like to write each of these lists on a separate file, *on a single line*.

For instance consider the following trivial example:

P := [[-.3819660120, .6180339880, -10000, -2], [.6180339880, 1.618033988, -10000, -1], [1.618033988, 10000, -10000, -.5], [2.618033988, 10000, -.5, -0.1e-3], [2.618033988, 10000, 0.1e-3, .5]]

I would like to create
 + a file named  P1.dat containing the line
     ...

writting data float

July 21 2011 by goli 125

Dear guys

In my program I have a loop and after some calculation I want to write the results. I use:

" writedata("D:\\arvin\\bao-cmb-h.txt", convert(T, array), float);"

but maple give me an error:

" Error, (in convert/list) object too large "

how can I write my data?

Thanks.



A := C/H/k*Q/R1/R2/(-1+R1)*(Q*R2*R1-R1*R2+1)-2*C*Q*(R1*R2+1)/H/k/(-1+R1)/R1/R2;

plot14:= plot(subs({Q=6,R2=8.75,k=4,C=1.96,H=7},A),R1=0..1,color=blue):

display(plot14,view=-15..10);

points:=op([1,1],plot14):

writedata("c:/khan/plotdata.txt",points,float);

Error, (in writedata) Bad data found undefined

 

Any one there?

Hi,

Im using odeplot to plot the solution of a system of ordinary differential equations. I would like to extract the data to save them in a file. Ususally I use

a:=plot(...);

points := op([1, 1], a); writedata("file.dat", points, float)

But when a=:odeplot(); this is not working.
Can please somebody help me?

Thanks,

Javier.

with plots

Eq[1] := 5*(diff(f(eta), `$`(eta, 3)))+(m+3)*f(eta)*(diff(f(eta), `$`(eta, 2)))-(2*m+1)*(diff(f(eta), eta))^2-(2*(2*m+1))*h(eta)-(m-2)*eta*(diff(h(eta), eta))

Eq[2] := g(eta)-(diff(h(eta), eta))

Eq[3] := 5*(diff(g(eta), `$`(eta, 2)))/Pr+(m+3)*f(eta)*(diff(g(eta), eta))-5*m*g(eta)*(diff(f(eta), eta))

BCs := [f(0), (D(f))(0), (D(f))(18), g(0)-1, g(18), h(18)]

pars := {Pr = .1, m = 0}

for i to 3 do eq[i] := subs(pars, Eq[i]) end do

I have some rather complicated equations which Maple couldn' solve analytically. So I plotted the intersect (which worked) and now I wanted to extract the data from the plot to use it in Origin. I managed to get the data with the op comand but somehow I can't use writedata to create a txt file.

In addition does anyone now how to get the length of the output array from intersectplot?

Is there a better way to get what I want?

I would like to include the current date in the filename when I use writedata.  How can I do that?

I know this doesn't work but I was trying to do something like this

  test:=[1,2,3,4,5,6]
  writedata("c:/data-FomatTime(%B%d%H%M).txt",test)

 

a:=Array(1..2,1..2,[[2,3],[4,5]])

writedata("c:/test.txt",a)

Error, invalid input: writedata expects its 2nd argument, Data, to be of type {set, hfarray, list, matrix, array(1), list(list)}, but received Array(1..2, 1..2, {(1, 1) = 2, (1, 2) = 3, (2, 1) = 4, (2, 2) = 5})

Since array is the deprecated version of Array you would think Array would work using writedata in Maple 12

But it does work with array.  Since I only have access to Maple...

Page 1 of 1