Items tagged with array array Tagged Items Feed


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?

Hi there,
I have a simple task to do with arrays. I have an 8x3000 array, whose columns are sometimes all zeroes (if any element in the column is zero then the entire column is zero). I want to eliminate the zero vectors, so I have this loop (the array is A)

for i from 1 to 3000 do
    while A(1,i)=0 do
    end do;
end do:

Setting "A:=DeleteColumn(A,i);" reduces the size of the array, so if all the zero columns have been deleted at "i=200", Maple will keep trying to check the next column, which doesn't exist anymore. This gives an "index out of bounds" error, but also records "A" as the new smaller array, which is fine.

If I run this loop inside a procedure, the error stops the procedure, but it doesn't record the new array, it stays as the older, larger one. Does anyone know of a way around this?

Any help would be much appreciated.

Hi dear experts

I'm wrote a complicated code for stress computation and define each component of stresses for n layers in a n dimension array.

for example (for srr component):  srr[1]:=f1(r,theta) , srr[2]=f2... , ..., srr[n]=fn(r,theta)

n is defined in the start of worksheet and is no. of layers!

so, i want to plot all of layer functions in a same coordinate plane.( beacause they are discontinuse and i want show that)

note: display command don't do that and plot them in a table form! :(

how can i do that?


thanks for participate.

I want do loop with comand for to generate 20 arrays with radon variable 

I do

for i from 1 to 20 do
for k from 1 to 20 do
X[k] := evalf(F[k])
end do:
end do;


But bug all

HI all,


I have 

> sol2 := dsolve({odesys, H(0) = 4995, R(0) = 65000, W(0) = 102000, l(0) = 96000}, numeric, method = rosenbrock);
print(`output redirected...`); 
proc(x_rosenbrock) ... end;


I want to have a list of my solutions, t, H(t), R(t), W(t), l(t) that I can put into a spreadsheet (.csv, .txt, etc.), for 600 timesteps. 


There are some answers out there, but I am confused by them, and have not been able to make it work.





I have an array/vector of values as results of a function:



Now I need the maximum of absolute values of G!!

=maple("max(G)") I have maximum, but I want =maple("max(abs(G))") But there is an error in this expression!!



To gererate a random initail cofigration -1 or 1

spin = (-1).^(round(rand(N)));


for i=1:1000,


neighbours = circshift(spin, [ 0 1]) + ...

circshift(spin, [ 0 -1]) + ...

circshift(spin, [ 1 0]) + ...

circshift(spin, [-1 0]);

how to do this in maple?

I have the following command.

message := `Kajian ini mempunyai tiga objektif pertama seperti yang ditunjukkan dalam bahagian 1.11. Objektif tersebut harus`;

m := convert(message, bytes);

block := map(convert, m, binary);
block := map2(nprintf, "%08d", block);
block := map(proc (t) options operator, arrow; [seq(parse(convert(t, string)[i]), i = 1 .. length(convert(t, string)))] end proc, block);

block := [[0, 1, 0, 0, 1, 0, 1, 1], [0, 1, 1, 0, 0, 0, 0, 1], [0, 1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 0, 1, 0, 0, 1], ........]

for i to l do
for j from 3 to 7 do
block[i][j] := 1-block[i][j];  //used to flip bit in between 3rd to 7th bit in a block
end do;
c_block[i] := block[i];
end do;
c_block1 := [seq(c_block[i], i = 1 .. l)];

Error, assigning to a long list, please use Arrays

May i know how to solve this problem? I need to change some bit in a list but receive error when there is more than 100 elements in a list. Thank you.

How can I use a matrix in timeseriesanalysis?


m3 := Import("d:\\bok6.xlsx")


Areachart works fine:

AreaChart([m3], color = "pink" .. "niagara Navy", title = "Tidslinje Tilluft og avtrekk")


But when matrix m3 is entered in timeseriesanalysis it gives a error:

ts1 := TimeSeries([m3], startdate = "2016-08-1", header = "Tilluft VAV setpunkt", enddate = "2016-08-01");

Error, (in TimeSeriesAnalysis:-TimeSeries) invalid input: too many and/or wrong type of arguments passed to TimeSeries:-ModuleCopy; first unused argument is [Array(1..4, 1..1, {(1, 1) = 155.0, (2, 1) = 142.0, (3, 1) = 133.0, (4, 1) = 122.0})]



I have loaded the following packages:

with*matrix  with*linearalgebra  with(plots)  with(Statistics)  with(TimeSeriesAnalysis)





I need to create n-order tensor filled with any symbolic variable, for exemple 'x', but "symbol" option works only on vectors and matrix, so i don't know how to do that on n-order array.

X := Vector(3, symbol = x);#------ Work
Matrix(3, 3, symbol = x);#------ Work

Array(1 .. 3, 1 .. 3, 1 .. 3, symbol = x);
Error, argument `symbol = x` is incorrect or out of order

And 2nd problem thet globaly i need to create symmetric n-order tensor with symmitry for any pair of index and with contraction for any couple of indexes equal to zero. As i understend i need to create a big list of equations for every individual pair of index and 2 conditions (contraction and symmitry) and solve it to get a match and combination of independent index and paste values in them?


Hello everyone!

I am wondering why the Tabulate command does not work with Explore. E.g.:

Explore(`DocumentTools:-Tabulate`([plot(sin(a*x)), plot(cos(x-a))]), parameters = [[a = 0 .. 10, controller = slider]])

I know that I can display an array of plots with the display(Array([....])) which works fine with explore but Tabulate is another good way to display multiple plots and it gives better control over individual plots properties (e.g. setting different size to different plots). Is this a bug or Tabulate is just not meant to work in that context?  


I am solving a system of differential equations with 2 variables. I can find numerical solution using dsolve with numeric option. I can also plot curves. But I also would like to extract data at time t0 and store into a file. I don't know how to extract numerical values from dsolve and store into a text file at various time, t0, t1, t2 etc. I would like to store data in tabular format with first, sceond and third columns are time, x and y respectively.


Just as an example, we can use

x'(t) = y(t), 

y'(t) = 6x(t) - y(t)

with x(0)=1 and y(0) = 2



I want to define a proc in Maple which gets an integer n and gives a set of arrays like {1,2,3}^n, meaning {[a[1],...,a[n]]|for all 1<=i<=n a[i] in {1,2,3}}. For a fix n, obviously one can use n-for, for example when n is 2

for a[1] from 1 by 1 to 3 do
 for a[2] from 1 by 1 to 3 do
 end for:
end for:

But when n is not fixed, how can I tell Maple to consider n for?! Also how can ask him to make a n-dimensional array?

Hi. Is there a maple function which can interpolate values from a simple table:

given (x,y) compute z value

eg z(0.5,0.5)=1.5


array:=[0,2,4;1,3,5;2,4,6] #probably the wrong input, but you get the idea


there is a method in vba:


say I have defined some (very simple, acting on a finite set M) functions f,g,h. I want to evaluate certain permutations, so I want to make a for loop that goes through possible combinations of functions in my array A=Array([f,g,h]). (In reality my array is a little larger.) No I don't understand how I can use the elements of this array as actual functions. Even if f is defined and I can evaluate, say, f(m), I cannot use A(1)(m) to evaluate m. The output is just "f(m)". How can I make maple recognize that we are having a function here?


Thanks it advance.

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