Items tagged with index index Tagged Items Feed

Hello,

I have a big problem and I don't know how to resolve it.

I have two matrices: A and B. I want to use B[1] as an index of A ,i.e., 

B[1] := [1, 1]; Ok

A[B[1]]; But this does'nt work. 

Thanks for your help...

I need this quite often, but never found a nice way of getting the index of minimal or maximal value of a Vector (or a list or whatever). Is there an easier way than the following?

N := 15:
L := LinearAlgebra[RandomVector](N):
m := min(L):
for i to N do if L[i] = m then print(i); break end if end do;

Hi. I have a question that concerns indices of vector of functions within for-loop.

I have a following piece of code:

I wrote a procedure that solves a volterra integral equation numerically. This procedure  takes N , number of radial basis functions, as parameter  .the problem is:Error,  bad index into Matrix

How can I fix this problem?

here is my procedure:



Variables with Indices

December 16 2011 by headbam 10 Maple

I would like to index Variable names like how it is common in physics (just as an addition to the variable name to distinct between say ta and tb just as two different times). However i am not sure how to do this and make maple treat for example ta EXACTLY like if it would be called ta.

int(1/2*m*(-x[b]+x[a])^2/(-tb+ta)^2,t = ta .. tb)

is evaluated but

int(1/2*m*(-x[b]+x[a])^2/(-t[b]+t[a])^2,t = t[a] .. t[b])

restart;
lucoef:=Array(0..4, (i->i^2+3));
j:=1;
lucoefnew:=sum (lucoef[r]*lucoef[j-r],r=0..j);

Error, bad index into Array

===========
What it wants from me?!

Hiim using maple 14 and tried to apply the sum of vector's elements, y appears a error (Error, unsupported type of index, n)

 

a := Vector(5, {(1) = 1, (2) = 2, (3) = 3, (4) = 4, (5) = 5});
> sum(a(n), n = 1 .. 5);

Error, unsupported type of index, n

 

please need some help

 

Thanks

Hi,

I need to do this:

A:=[1,3,5,2,7];
B:=[2,5];

f(B,A)=[3,7]

Notice that the elements in A can be lists themselves. How can I define such kind of function?

TIA for the help

If I have the following expression 

K:=(j)->j  is an expression where j an index run from 1 to 10

Now, I want to fill a row matrix with this expression as follows

A := Matrix(1, 10, K)

I think this is true where the result is [ 1  2  3  4  ..... 10]

but this is not  true in maple

the result is     [1  1  1  1 ..... 1] 

can any one tell what is the truth.

Is there a direct command to give the (first) index in a list,
for which the entry coincides with some given value (without
coding a loop, to run through the list)?

---

PS: when I enter that question I automatically get an info,
that similar questions exists. But clicking on those links do
not give usefull infos, they just lead to a page of old threads
(Page 529 of 569 for the first link ...)

Page 1 of 1