Items tagged with list list Tagged Items Feed

I want to paste a list of points generated by another program into a maple worksheet. 

However, when I paste the list of points into the Maple worksheet, I get a command prompt after each defined point in the list.  Whereby, the executable code will not run.

I need a way to paste the list of points into the worksheet without any command prompts.  Is there a special entry mode?  

 

Here's the list of points I want to paste into the worksheet:

[

[20,0,0],

[20,4,0],

[19,8,0],

[17,11,0],

[14,14,0],

[11,17,0]

],

 

Below is the worksheet code that I want to paste the list of points.

However, when I paste the list of points within the "pointPlot3D" function -- I get a command prompt after each defined point in the list of points.  (So 30 points gives 30 command prompts.)  Whereby, when this code is executed, there is an error.    What I need is a means to paste this list of points into the worksheet WITHOUT the command prompts showing up. 

 

> with(geom3d):

> with(plots):

> sphere1:=(x,y,z,R)->[x+R*cos(phi)*cos(theta),y+R*cos(phi)*sin(theta),z+R*sin(phi)]:

> Explore(display(        

       plot3d(sphere1(0,0,0,Rp),phi=-Pi/2..Pi/2,theta=0..2*Pi),  

               scaling = constrained, axes = boxed, style=wireframe, labels=[x,y,z],                

       pointplot3d(

> [
> [20,0,0],
> [20,4,0],
> [19,8,0],
> [17,11,0],
> [14,14,0],
> [11,17,0]

> ],

               symbol=circle,symbolsize=10)  ),        

       parameters=[Rp=3..20],         initialvalues=[Rp=20] );

 

I have a list L:={1,2,3,4,5,6,7,8}. I choose three elements from list L. How many different combinations of three numbers can be selected from L so that the numbers could represent the side lengths of a triangle?

I need to make a lot of similar calculations and wonder if it can be done in a smart way in Maple. Microsoft Excel is perfect for this kind of calculations, because you can downcopy cells. I would like to do everything in Maple, if possible, though. I have a number of points A, B, C, D, E, ... , which all lie on various circles in the plane. For every point radius and angle is given, so actually you can say that every point is delivered with polar coordinates. I want to have their rectangular coordinates. 

Maybe I could deliver their radii in a list and their angles in degrees in another list?

r:=[12,56,29,...., 78]:

v:=[15,45,75,..., 102]: 

......

I need to be able to refer to a certain point thorugh an index. At best it would be A, B, C, ... , but 1, 2, 3, ... will be acceptable. So in the end I need to be able to access say x_C and y_C or x_3 and y_3 (understood as index lowered). I hope someone can help me do the task in a nice a efefctive way.

NB! Maybe you have a solution, which involve transformation from polar to rectangular coordinates. That will be nice, but please also tell me how it can be done from scratch, because I want to be able to know about handling many points at once for other purposes, when the function is not r*cos(v), but an arbitrary function.

Regards,

Erik

eq:=[Vector[row](4, {(1) = 0., (2) = 0., (3) = 0., (4) = 0.}), Vector[row](4, {(1) = -0.3381778526e-2, (2) = -.3381778526, (3) = -.3185010532, (4) = 0.}), Vector[row](4, {(1) = 0., (2) = 0., (3) = 0., (4) = 0.}), Vector[row](4, {(1) = 0., (2) = 0., (3) = 0., (4) = 0.}), Vector[row](4, {(1) = 0., (2) = 0., (3) = 0., (4) = 0.})]

how i can get a unique results:[Vector[row](4, {(1) = 0., (2) = 0., (3) = 0., (4) = 0.}), Vector[row](4, {(1) = -0.3381778526e-2, (2) = -.3381778526, (3) = -.3185010532, (4) = 0.})]

 

I need a list version of Contourplot. I have a list in the format [[z1,x1,y1],[z2,x2,y2],...[zn,xn,yn],...]

where z represents some data value at coordinate (x,y). Basically I need a 2D figure with the x and y values shown on the axes and the z-value represented in a color code. Just like "contourplot" except in my case I cannot use it since I do not know the general function of two variables but only the list  with the data points. Is this possible with a built in Maple command?

 

Thanks

 

 

Hi, 

i have this:

and i don't want the letter to be strings.

I want something like:

[z,d,i,p,s,...,y]

Thank you a lot

So if i have a list of numbers X:=[1, 3, 8, 9, 10] for example, how do i calculate the Σx*ln(x) for each x in X ?

 

im certain it must be possible but i cant figure out how.

 

thanks for your time :)

I have the following procedure to do the above. It works but it returns [9,10],[10,9],[12,1] for n=1729(for example). How do I modify this to 

a) to count 9,10 and 10,9 as the same and hence only show one of them

b) get 1,12 to show as a solution?

cubesum:=proc(n::nonnegint)
global listcub:=table();
local k:=0, x:=iroot(iquo(n,3),3),y:=x,x3:=x^3,y3:=y^3;
if 3*x3 <> n then x=x+1; x3:=x^3;y:=x;y3:=x3 end if;
while x3<=n do
y:=iroot(n-x3,3); y3:=y^3;
if(x3+y3 = n) then k:=k+1; listcub[k]:=[x,y]end if;
x:=x+1; x3:=x^3;
end do;
convert(listcub,list);
end proc:

 

I currently have a function quadsum(n) that determines the [x,y] solutions of the above equation for an integer n. :

quadsum:= proc(n::nonnegint)
local
k:= 0, mylist:= table(),
x:= isqrt(iquo(n,2)), y:= x, x2:= x^2, y2:= y^2;
if 2*x2 <> n then x:= x+1; x2:= x2+2*x-1; y:= x; y2:= x2; end if;
while x2 <= n do
y:= isqrt(n-x2); y2:= y^2;
if x2+y2 = n then k:= k+1; mylist[k]:= [x,y] end if;
x:= x+1; x2:= x2+2*x-1;
end do;
convert(mylist, list)
end proc:

How would I alter this so that I get [x,y] for n= (5^a).(13^b).(17^c)(29^d) for non-negative integers a,b,c,d?

I am trying to take a list of prime numbers that I already generated with the following:

L4:=NULL:

for i from 2 to 50 do

if nops(ifactor(i))=1 then L4:=L4,i end if:

end do;

[L4]

This gives me the primes bewteen 2-50, [2,3,5,7,11,13,17,23,29,31,37,43,47].  I want to write something that takes the products of my list like this

2*3=6

2*3*5=30

2*3*5*7=210

and so on through the whole list.  Any ideas?  I figured out how to take the product of 2*3, 2*5, 2*7 and so on, but I cant figure how to make it do 2*3, 2*3*7 and so on.

I am doing a presentation on Euclids infinite prime proof and thought it would be cool to write a maple program that will show his proof for a certain amount of prime numbers.

 

Thanks,  Matt

 

 

 

I paste below a simple code illustrating what I want to create: two lists from a set with pairs. I wonder it is a very simple task but I my lists aren't create in the end. 

 

 

> restart;
>
> lista:=[[1,10],[2,20],[3,30]]:
> x:=[]:
> y:=[]:
>
> for i from 1 to nops(lista) do
>     for j from 1 to 2 do
>
>         if j = 1 then
>             x[i,j]:=op(1,op(i,lista));
>        fi;
>        if j = 2 then
>             y[i,j]:=op(2,op(i,lista));
>       fi;
>    od;
> od;
>
> x;
> y;

 

 

In resume then after the for loop is terminated I want to be left with two lists:

x:= [1,2,3] and y:=[10,20,30]. I'm sure it has a quick fix but I'm stuck and would appreciate any help/advice.  

Thanks in advance!

Following is the set of commands I performed.

> points := plots[implicitplot](t+sin(8*x^3*t)-x^3 = 0, t = -0.50e-1 .. 0.5e-1, x = -10/9 .. 10/9);
print(??); # input placeholder
> ptslist := convert([1, 1], points, listlist);

In an output I need the data at the specified values of t. It will be great favor, if someone can help me out.

Thanks

Hi there,

I've been trying to find an equivalent to MATLAB's unique command in Maple, but I had no success.

I've seen that Maple would return the elements that are either repeated (FindRepetitions) or not repeated (MakeUnique), but not the indices within the original list.

Is there way to do that?

Thanks,

jon

I am required to generate a list containing the square of numbers 1 through k where k is an arbitrary int,defined from 1 to n. To do this, I've currently got the following commands:

local k, mylist:=[];

for k from 1 to n do

mylist[k]=sumsquare(k);

end do;

where sumsquare() is a procedure I defined to compute the sum of the squares of 1 through a number passed as an argument

At present this gives me an out of bounds error. 

How can I initialize mylist to be of size n, like in other languages such as C++?

 

Page 1 of 1