Items tagged with print print Tagged Items Feed

for i from 0 to 3 do print("rawData[", i, "] = new double[] { ", hello(i+1), ",", data[i+1], "};") end do

wrong format after copy to notepad from the maple 15

do not know why it insert a empty line, and make "};" in another line

and there is unexpected " 

 

wrong format example:

"rawData[", 0, "] = new double[] { ", 73.25, ",", 0.1510425143,

"};"
"rawData[", 1, "] = new double[] { ", 73.15, ",", 0.3974080269,

"};"
"rawData[", 2, "] = new double[] { ", 72.85, ",", 0.4661517269,

"};"
"rawData[", 3, "] = new double[] { ", 73.25, ",", 0.3974080269,

"};"


expected format:
rawData[0] = new double[] { 25.0, 20.0 };
rawData[1] = new double[] { 27.0, 34.0 };

Let's say I have something like

 

p1:=((a+b+c)*t + (a^2 + b^2)*t^3)*(c^3a^b + a*b)*t^2 + (1/(b^2 + a^3)) + b + 1/c^7)*t^7 = 0;

 

or something complicated like that.

 

Would it be possible to print the polynomail up to say order 3?

 

I want to be able to print

 

collect(expand(p1),t) up to order 3 and see the resulting coefficients

When I print a Table with graphs in it, the graphs are compressed vertically to an extreme extent. There has to be some compression from the screen, of course, since I have a wide-screen (although the actual worksheet does not use the whole screen width because of the palette and the fact that I don't use full-screen mode. However, the vertical compression  (that is, in a direction where there is plenty of room on the page) is many times more than the horizontal compression. In order to get the printed graph to look normal, I have to stretch the screen graph vertically an extreme amount, which, of course, looks horribly distorted on the screen.

Also when printing a graph as part of a Table, the graph area is clipped so that the title and legend do not print.

I thought that the Table struction would be a good way to display related graphs. But this behavior is making the use of Tables tedious and much less satisfactory because of the missing titles and legends.

None of these things happen when I print a graph in a regular execution group outside a Table structure.

Has anybody else had this problem, and have you found a way to avoid the compression and get the legends?

How do we print "Hello" in green in a .mw file in Maple 13?

Thanks!

mapleatha

Short question version:

print(plots[display](seq(seq...   ...)):  works fine!  Why??

Longer, more detailed question:
  print(plots[display](seq(seq...   ...)):   This Maple statement ends in a colon - so I would not have expected any output.  I'm using "pretty" print, as opposed to printf, because it automatically centers the output

    This question is actually an extension of one I posed  yesterday, under the title "How to clear Maple output" - but the question I should have been asking is: "Why is the previous output not automatically cleared?"  The main points of that question are stated below.  Any comments, suggestions gratefully received.

   David

"How to clear Maple output"

I'd like to know how the screen previous ouput can be cleared.   ...or what is the likely cause.

   At the start of my program I have:

restart;
interface(echo=0, verboseproc=0, warnlevel=0, prettyprint=1):

#I thought restart; would automatically have cleared any previous output.

The program reads necessary input (eg no of players, ..)  using:

x:=readline(terminal):

I have couple questions on displaying/printing items I see from ShowContents(LibLocation). Here is an example

restart;
with(LibraryTools):
LibLocation:=cat(kernelopts(mapledir),"/lib/maple.mla");
c:=ShowContents(LibLocation):


First quesionNow, when I do
c[1];
then I see

When is "%?.m" there? Is this suppoed to be an actual function one can print?

second question

c[30]; gives

But when I do:

interface(verboseproc=3);
print(AiryBiZeros);

I get listing that ends up calling

---------------------------
proc(n::{algebraic, algebraic .. algebraic})
local fn;
   1   if nargs <> 1 then
   2     error "wrong number of arguments"
       end if;
   3   fn := traperror(evalf(n));
   4   if type(fn,'numeric') and not type(n,'posint') or type(fn,('numeric') .. ('anything')) and not type(op(1,n),'posint') or type(fn,('anything') .. ('numeric')) and not type(op(2,n),'posint') then
   5     error "expecting positive integers in argument"
       elif type(n,('integer') .. ('integer')) and op(2,n) < op(1,n) then
   6     NULL
       else
   7     ('AiryBiZeros')(n)   <----- Is this C function/compiled that is why it does not show?
       end if
end proc
--------------------------------------

Which is the same name I printed. So it seems to be another internal procedure with same name? How can I print it as well?

Is there a better way to print Maple procedures/command than what I am doing above so one gets full listing?
I tried Browse(); command in LibraryTools, but found it very cluncky to use (keeps losing listing and screen become blank. Very buggy)

Hi,

print_result.mw

How could I convert HFloat type number to a number?

My ultimate aim is to print the ouput in a "nicer" wa, like this

 

printf("Minimum value is: 2.440\n");
printf("x=2.257\n");
printf("y=0.000\n");

and possibly can be written to a file (using writeto).

 

Thanks,

 

I have a function. It's calculating coefficients of a polynomial.

So when it's done, I have the variables a0, a1, a2,a3 ... aN

where N is an input value and could be any positive integer.

 

Now, I just want to show them on the screen. So if I have, say , a0=1.3 and a1=5.76, I want this to appear:

1.3x + 5.76x2

 

That's all. I just want a loop that does this:

for term from 1 to N do:

    print( a0 ); print (x^N); print ("+");

od:

so all the terms come out on the same line, as in my example above. I've tried so many ways, but each time it ignores the numerical values of a0 and just writes "a0" on the screen, or breaks it up into a set, or puts || marks everywhere, or does it on sequential lines, or something or something or something.

Hi, i'm wondering if theres anything i can do printf and print and have the outputs on the same line. I want the string wihtout any quotations so i think i can only do printf to get this, but then i'm putting an entry out of an array after this. This is a small example out of my code, i would like the output to be all on one line:

The synchronising vector is (S[j-1]) The synchronising word is (X[j-1]) The length of the synchronising word is ...

 

if (sync=true) then 
printf("The Synchronising vector is"); print(S[j-1]);
printf("The sychronising word is");
print(X[j-1]);
printf("The length of the synchronising word is");
print(length(X[j-1]));
else printf("There is no synchronising word"); 
end if;

 At the moment its outputing each print on a new line.

Any help would be much appreciated, thanks.

 

Is there any simple way to print the sum of a series with exceptions?

For example, the following works (sort of), but its not consistent with mathematical notation, where one would expect to see something like a Sigma^' printed out, and the condition, alongw ith ther limits appear under the Sigma sign:

[Sum(1/(k^2-p),k=0..infinity),And(k<>p)]

M:= Matrix ([[a,b], [c,d]])

If a.d-b.c=0 then print (Matrix(2)); else print (Matrix ([[(d/a.d-b.c), (-b/a.d-b.c)], [-c/a.d-b.c, a/a.d-b.c]]); end if;

 

I don't understand where I have gone wrong. If anybody could help I would be greatly appreciative

Thank you

I know how to define a procedure and use print() as follows:

test := proc (x)
  print("x is equal to: ");
  x
end proc

This displays as follows:
test(2)

"x is equal to: "

2

But i would like to appear as follows:

x is equal to: 2

 

Where the "x is equal to: "-part is standard a "text-mode-block" with green color.

Can i accomplish this in Maple, and can i do more advanced formatting?

 

Best regards,

Martin

Hi, I am currently creating a procedure so that i can input two matrices and a vector and multiply them together in different patterns, I want the result to be either one of the vectors {4,0,0,0} or {0,4,0,0} or {0,0,4,0} or {0,0,0,4}, I am trying to create an if loop that says is one of the S's is equal to one of these print ("Synchronising"), I have decalred these vectors inside the procedure and all the S's but my if statement is still not working. I think S needs to be decalred more clearly inside but i'm unsure what to do, any help would be much appreciaited! Here is my procedure:

 

proc_cerny1:=proc(A::Matrix,B::Matrix,C::Vector)
local s, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, e, f, g, h;
s:=C.A;
s1:=C.B;
s2:=C.A.B;
s3:=C.B.A;
s4:=C.A.A;
s5:=C.B.B;
s6:=C.A.A.A;
s7:=C.B.B.B;
s8:=C.A.B.B;
s9:=C.A.B.A;
s10:=C.B.B.A;
s11:=C.B.A.A;
s12:=C.A.A.B;
s12:=C.B.A.B;
s13:=C.B.A.A;
s14:=C.B.A.A.A;
e:=Vector([4,0,0,0],orientation=row);
f:=Vector([0,4,0,0],orientation=row);
g:=Vector([0,0,4,0],orientation=row);
h:=Vector([0,0,0,4],orientation=row);
g:=Vector([0,0,4,0],orientation=row);
if (s7 = e)then
print("Synchronising")
elif (s7 = g) then
print ("Synchronising")
elif (s7 = h) then
print ("Synchronising")
elif (s7 = g) then
print("Synchronising")
else
print("Not Synchronising");
end if;

return s, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14;
end proc:

 

Thanks 

I need the list of x and y separately of S[2] like the:

[.8098169753, 0.8098169753, .8098169753, .8098169753, .8098169753, .8098169753]

[1.339721710, 1.309892054, 1.282898312, 1.258277638, 1.235670705, 1.214793049]

 

 

restart; with(LinearAlgebra);
a := 2; b := .29; d := 1.85; for h from .5 by .1 to 1 do
eq1 := x*(-b*x^2-x+1);
eq2 := y*((a*x*x)/(b*y^2)-d-h*y);
S := solve({eq1, eq2}, {x, y});

I want to use a do loop to calculate some values of a function and print out the answers.
The result I want is of the form f(1)=17, f(2) = 21, etc. If I try


for j from 1 to 3 do
print( 'f(j)'=f(j) )
end do;

the j is not evalued and I get f(j)=17, f(j) = 21, etc.

I am now using Maple 15 and 16.

 

Thanks

1 2 3 Page 1 of 3