protrader

409 Reputation

7 Badges

17 years, 61 days

MaplePrimes Activity


These are questions asked by protrader

M:=Matrix([[1,2,2],[3,2,0],[4,5,7],[8,3,5]]);

I want to pick the 2nd column (and/or row) from the above matrix and put the values into a vector, how can I do this?

results:

V1=[3,2,0]

V2=[2,2,5,3]

 

I want to build a list or vector out of 2 vectors containing values and 2 lists containing the order in the total list (or vecotr), I was wondering if there is a very simple way to do this instead of using loops?

NbNode:=6;
These are values:
U:=<1,2,2,3>;
UElim:=<0,5>;

And these are orders:
Elim:=[2,4];
ListEqn:=[seq( i, i=1..NbNode )]:
ListEqn:=subsop(seq(i=NULL, i in Elim), ListEqn);

The final result should be:

Utot=[1,0,2,5,2,3]

 

restart:
A:=Vector(<2*u[1]+u[2],3*u[1]+u[3],5*u[2]-u[3]>);
U:=<1,2,3>;
for i to 3 do
A:=eval(A,u[i]=U[i]);
od;

How can I do this in a simpler and faster way? I will do this procedure for many times with larger vecotors and matrices.

TIA

 

We want to add 5 to the list L:

with(ListTools):

L:=[1,3,6,7];

L:=[L,5];

L:=Flatten(L);

 

I think there must be an easier way to do this, I would be thankful if someone let me know.

Can we define functions in Maple? If so, what is the difference between a user-defined function and a procedure?

3 4 5 6 7 Page 5 of 7