Items tagged with array

Hello!

I am working in a simulation, which requires me to create a checkerboard of values which I paint afterwards according to its value. The idea is to create a sequence of images (which I could export for every iteration and create into a gif/timelapse afterwards). The problem I am encountering is that when I try to plot it, I only obtain a difuse coloring scheme, without having a specific color for every pixel.

if you search for the color command in plots (http://www.maplesoft.com/support/help/Maple/view.aspx?path=plot/color) one of the examples is more or less the result I want, but I would like to have it without the gridlines and being able to control the color according to the value of the matrix in said position.

 

My current attempt, and the one closest to the solution is:

 

R:=Matrix(1..N,1..N, datatype=integer); for x from 1 to N do for y from 1 to N do R[x,y]:=P[x,y,2]*18+P[x,y,3]: od: od:R;
#P is the matrix where I do the calculations and R is the matrix I want to plot after every step of the calculation.

surfdata(Matrix(R), 1..N, 1..N, style=surface,
         dimension=2, labels=["x", "y"],
         gridsize=[100,100],
         colorscheme=["zgradient",
                      ["Indigo","Blue","Cyan","Green","Yellow","Orange","Red"]]);
#the surfdata I resqued from another proyect I had. I know it is not thought for this tipe of grafs, but it was the closest I could come by.

 

I do not know if it is a better idea to use an Array or a Matrix to plot this. While the P array isn''t touched, I do not mind modifying in any way the R matrix

Thank you,

Enrique
 

Ok, I'm  a confident Matlab user, but for some reason Maple befuddles me.

Let's say I have two functions, x=f(t) and y=g(t) and I want to fill both two vectors with values, with t=-n:n.  How do I construct a loop to do that?

I'd like to make a graph like the below. So I know that using the display command and putting graphs in matrix form produces something similar (display(<graph1|graph2|graph3>), however it doesn't allow me to export it as one graph. Any ideas?

 

 

Hi

I'm trying to add a new element to an array to a position that doesn't exist (length+1). According to the Maple help sheet, automatic resizing should take care of this. Instead I'm getting the error 'Error, invalid left hand side in assignment'. I tried this in a new worksheet. This is the entire code

L:=Array():
L:=(1,2,3,4,5):
L:=(6):
L;

When I run this, it kicks that error and only returns 1,2,3,4,5

When I do this to a 2D array it seems to work which has confused me more!

Thanks for your help

I want to have a display() function that plots a certain expression that I already have defined, but then I also want to include a variable number of pointplots into the same graph. I basically want the user to define a set of x and y coordinates into two different arrays in the start of the Maple Worksheet, then later down the worksheet, I want to plot these x,y coordinates as a pointplot, for each point.

But for example, if there are 5 points, I would define the pointplots as p1,p2,p3,p4,p5, which I already have a loop to do automatically depending on however many points that has been defined in the previous arrays. But when I want to plot these in a display() function, I have to write display(p1,p2,p3,p4,p5) individually, and I can't therefore seem to find a way to make it like display(p1,...,pn). I want the display to add more pointplots depending on how many points are defined in the arrays.

Can anyone help me? Sorry if it was difficult to understand, I can explain further if you didn't understand.

Hello

I am trying to write my Measuring Data into several Arrays with lengt of rowdim

I was able to extract them from the Datafile and Refering them to separate Vectors

My Code is in the attachemend and the Datafile too.

Insert the txt Path in the Messdaten in definition of A to load it.

I was able to convert the Time from Seconds to Minutes. What i realy want is an x-Axis wich is like hh:mm:ss

and Plot for Example T__1,T__2,T__Scheibe together in one Plot as y Axis and t__Minuten as x Axis

But the

plot([seq([`t__Sekunden`[i],`T__1`[i]],i=1..rowdim,LinearAlgebra[rowdim](`t__Sekunden`))

doesnt work and i also tried others

Thank you for your Help

 

Previous year I was using Maple 2015 and I had a procedure in which I had used

A := Array((1 .. 3)$3);

And similar use of $. This year I'm using Maple 2016. Now I came back to my old procedure but Maple doesn't compile the procedure anymore and instead shows

Error, `$` unexpected
What is the problem? Is something changed in new version of Maple?

Why I use Array and $ is my old question here http://www.mapleprimes.com/questions/210628-Undefined-For-Loop-Bound which was fine before.

Let say I have an array

A := Array([[1], [2], [3]])
Normally if I would like to extend it I will write, eg:

Extend(A, [[4], [5]])

But because this is not 1D array Maple will rise an error. Is there a way to go over this limitation?

Dear Pros, I'm a biginer so I have a question about my program.

I have a lot of arrays which are result from 2 while loop. Now, I want creat a matrix from them but i can't. So, could you help me to do it.

For detail: 

V[1]:=[ 1 2 3]

V[2]:=[2 3 4]

V[3]:=[3 4 5]

V[4]:=[2 6 7]

V[5]:=[7 8 9]

...

V[n]

with type of V[i] is a array.

I searched and found a solution by manual to create a matrix as follow:

V_matrix:=<V[1],V[2],V[3]>

but in this case i can't but manual with n=100

please help me to have a Matrix.

Thank a lots.

Hi everybody, 

 

Could somebody just explain me why commands L[1..5] and L[3..6] below do not seem to return "the same type of thing" ?

 

L := Array(1..10, [$(1..10)]);

L := Array(1..10, {(1) = 1, (2) = 2, (3) = 3, (4) = 4, (5) = 5, (6) = 6, (7) = 7, (8) = 8, (9) = 9, (10) = 10})

(1)

L[1..5];
whattype(%);

Array([1, 2, 3, 4, 5])

 

Array

(2)

L[3..6];
whattype(%);

Array(3 .. 6, {3 = 3, 4 = 4, 5 = 5, 6 = 6}, datatype = anything, storage = rectangular, order = Fortran_order)

 

Array

(3)

 


Thank you for your attention


Download array.mw

It seems as if arrays can only be displayed in 2-D form when the array dimensions start at 1.

Sometimes I want to construct arrays where an index starts from 0 (or other values). This is purely for my convenience in some problems. However such arrays do not display in 2-D form. Consider the displayed form of

Array(1..4,1..5,(i,j)->i+j);

Array(1..4,0..4,(i,j)->i+j);

Why doesn't the latter 'display' in 2-D form?

I am getting the error that maple was unable to allocate enough memmory for the computation. I have seen that some of the values could have been stored in a remember table so that they are accessed whenever needed. I am however using arrays and maple cannot tell when the entries in an array change, how about option cache? can that be useful? if not, how can I optimize my storage space?

Hi,
I have this lists and I have written a program to process these lists and produce only the lists that certisfy a certain condition. Instead of printing these lists, I want just the total number of the lists produced. How can I do these? The only thing I can think of now is to append the lists in an Array and get the number of elements in the array, but this will be very inefficient since I am looking at a very big number here.

 

Any help is appreciated,

Thanks.

Vic.

Hi there,

            I am new to maple. I want to ask a simple question.

            If I have a array, and I want its each component to take natural logarithm. How can I do?

            Eg:[2 3 4]->[ln(2) ln(3) ln(4)]

            Thanks in advance.

Dirichlet

Hello,

I have a number of outputs, and I want to put them into an Array witrhout specifying the index of the array, is there a way I can put all of them at once without putting them one by one? I am currently using Append, is there any other way other than Append?

1 2 3 4 5 6 7 Last Page 1 of 28