# Items tagged with indexingindexing Tagged Items Feed

### Maple index help

Yesterday at 6:37 PM by Maple

Hi, i am new to Maple. I was trying to solve some problem and came up with the following difficulty:

When i give input

ai=(1+ki)/(1-ki);

and then do a_1 it gives the proper output as

(1+k1)/(1-k1);

But whenever i try to do

ai,j=(ki-kj)

### indexing of matrices and other rtable...

April 14 2013 by Maple

1

3

I often have large matrices and have to grab only every nth column or row (for plotting

for example). So far I've been doing it this way:

nthColumns:=proc(v_m, v_n)
v_m[..,[seq(i, i=1..rtable_size(v_m)[2], v_n)]]
end;
nthRows:=proc(v_m, v_n)
 v_m[[seq(i, i=1..rtable_size(v_m)[1], v_n)],..]
end;
A := LinearAlgebra:-RandomMatrix(20, 20, outputoptions = [datatype = float[8]]);

### is there a member() function for Vectors...

November 14 2012 by Maple 15

2

8

Hi there,

I have a piece of code that uses lists instead of vectors and recently, it crashed, it ran out of memory. Long story short, if I use vectors instead of lists, the performance is much better and optimal (this I knew but I was lazy to translate all my code). However, there's one single line that I cannot efficiently translate and it's the one that uses the function member(). Before, I had the following (it's an oversimplification of my code in order to easily discuss it in here):

### This does not make sense

June 01 2012 by Maple 16

0

1

This does not make any sense to me :-)

restart:
A := Matrix([[seq(i, i = 1 .. 10)], [seq(i, i = 11 .. 20)], [seq(i, i = 21 .. 30)]]):
A[.. -1,..] ;
A[.. -2,..] ;

You would assume that A[..-1,..] would remove the last row but that is not the case!
Instead you have to do A[..-2,..] he he it seems a bit odd!

### How can I retrieve the indices of specific...

March 10 2011 by Maple 14

0

8

I have a matrix (M) and it has both 0 and 1 as entries. I want to have a sequence/list of all indices associated with the entries equal to one (the others are irrelevant to me). I can use a nested for loop with an if statement, but I find that the easy way out and not very pretty. Is there is more sophisticated way, hopefully faster way of achieving this (using sequences, attributes, select/remove)?

Example:

M:=Matrix([[1,1,0],[0,0,1],[1,0,1]]);

### Creating and displaying arrays with...

October 31 2010 by Maple

0

5

Hi, I am a student (with some programming background) in desperate need of help.

How can I create a zero based array in Maple and display it?

I am having all kinds of trouble creating vectors and arrays in Maple (the help is cryptic). This is the closest I got:

>F := Array(0 .. 4, 0 .. 4, [0])

That creates a 5x5 array of zeros, with the upper left element indexed by (0,0) (right?).

How do I display the array?

### Manipulating Matrices

September 03 2010 by Maple 14

1

3

Hi

I have some difficulties in manipulating matrices in Maple

For example, I have a matrice with 40 rows and 9 columns ans I want to extract the odd rows taking columns inchanged. The new matrice which has 20 rows and 9 columns must replace the old matrice

In Matlab, I do this with only one command: WTable=WTable(1:2:40,:);