Items tagged with procedure procedure Tagged Items Feed

error in procedure

April 24 2012 by tim656 0

i'm writing this program and for some reasons i got this error, here is my code

maplet_error.mw

 

evaluating `"myadd(1)"` produces the error: invalid input: myadd uses a 2nd argument, n, which is missing.

the second question is that my procedure only calculate any integer number from 0 to 9 , is there anyway to get this procedure

to calculate bigger...

I wrote my own maple library. Some of its procedures require the LinearAlgebra-library.

Is there a way to automatically load LinearAlgebra when loading my library? (I tried to use 'use' but it didnt help )
Currently i load my library with

read "/home/..../something.lib";

Is there any good refernce to learn how to write maple libraries the right way? the maple help isnt actually very helpful.

i need help please

April 10 2012 by joannjubin 10

i have a procedure like this 

>f:=x-> A*x^2 - B*x -C:
   Bisection:= proc(f,a,b)
   local c;
   x:=evalf((a+b)/2);
   if abs(evalf(b-a))<=0 then return c; end if;
   if signum(f(c))=signum(f(a)) then
   Bisection(f,c,b);
   else
   Bisection(f,a,c);
   end if;
   end proc;

I need to make a procdeure which checks whether a list L is a palindrome or not. Any help would be appreciated.

Hi,

i want to use "dsolve({ODE1, IC1, IC2},numeric)" in a procedure. But it has some problems with the curly brace. Is there a special command to replace the curly brace?

Thanks

matrix question

April 03 2012 by joannjubin 10

i have 2 matrices :    |1 2 3|     |1 2 3|
                               |4 5 6|     |4 5 6|
i have to multiply there 2 matrices like below

a= (1*6)+(1*5)+(1*4)+(1*3)+(1*2)+(1*1)=21
b= (2*6)+(2*5)+(2*4)+(2*3)+(2*2)+(2*1)=42
c= (3*6)+(3*5)+(3*4)+(3*3)+(3*2)+(3*1)=63

Hi, these are what I have, I'm trying tot get a set of answers.

elenum:=16:

nodes:=elenum*2+1:

L:=evalf((Pi*2)/(elenum*2)):

interface(rtablesize=infinity):

E0:=Matrix([[L/3,2*L/3,L/3)],[(2*L/3,11*L/15,2*L/3)],[(L/11,2*L/3,L/110]]):

for i from 1 to elenum do
node:=(2*(i-1))+1;
E0M[node..node+2,node..node+2]:=E0M[node..node+2,node..node+2]+E0
end do:

E0M:

What should I do if i want a different outcome of...

Merge two sorted lists

April 01 2012 by asghar 0 Maple

Okay so my proff wrote the following procedures to sort a list and they obviosuly work. Now I want to write a procedure that can merge two sorted lists (using SelectSort). I am trying to write merge as a procedure but to no avail. Can anyone help me out?

getListSize := proc (L)

local vv; vv := Vector(L);

return LinearAlgebra[Dimension](vv)

end proc

 

swap := proc (L, i, j)

local temp, vv;

vv := Vector(L);

Hi everybody:

was wondering if someone could help me figure out what change took place in Maple 16 so that the expression shown below does no longer work

A:=a->Matrix(2,2,[[a,3*a],[a,4]])

It worked OK until 15

thanks

karamand

The following simple code

myproc1:=proc({parlist::list:=[]})
return parlist[1];
end proc:

myproc2:=proc(parlist::list)
return myproc1('parlist'=parlist);
end proc:

myproc2([1,2]);

fails with


Error, (in myproc1) invalid subscript selector

The reason is that myproc1 has the optional argument parlist, which has the same name as myproc2. myproc2 seems to make...

write procedure

March 28 2012 by jo88 0

given : A(n+1)=2*A(n) , A(0)=70

write a procedure and find A(5)=?

write a procedure

March 27 2012 by davidp 5

given a recursive sequence : J(n)=b*A(n)  for b=0.5 , A(0)=70% , n is integer

wrote a procedure to find J(n), for example: find J(5)=?

 

i need help with this please .

I have two list, x1 and d, I want to make a piecewise function out of them and plot it, but I may have some other stuffs like this so I decided to write this procedure in a proc, the proc makes the input of the piecewise right, but when I want to make a function out of this and pass it to plot this does not works properly, I tried something else; first assigned a seri to a variable and passed it to the piecewise to make a function out of it this does not works either, but when...

I got an MS Excel file where the matrix (7054x60) is created and the last row of the matrix is used for optimization of its (the matrix) values. In Maple you can create the matrix as follows:

M := Matrix(7054, 60):
for i to 10 do M[1, i] := 1 end do:

Mat_proc := proc(x)
  local i, j;
  global M;
  for i from 2 to 7054 do

1.how to plot a equation include two complex variables?

e.g.,0.1501071588582623569e-19 * s1 ^ 2 - 0.1770422954406499377e-11 * s1 ^ 2 * s2 ^ 2 + 0.1526369514180028298e-19 * s2 ^ 2 - 0.8979700309848614490e-12 * s1 ^ 4 - 0.9507487955845430138e-12 * s2 ^ 4 + 0.4941234607542336257e-4 * s1 ^ 4 * s2 ^ 2 + 0.5029096170369867504e-4 * s1 ^ 2 * s2 ^ 4 + 0.1631266049971375518e-4 * s1 ^ 6 + 0.1557291987414385136e-4 * s2 ^ 6 - 0.3925287034197085366e3 * s1 ^ 6 * s2 ^ 2 - 0.5855115617172747465e3...

1 2 3 4 5 6 7 Page 1 of 8