santamartina

40 Reputation

One Badge

2 years, 77 days

MaplePrimes Activity


These are questions asked by santamartina

Dear friends, please, I would like to ask for your help with the following problem. 

When I try to compile a code like the following 

P:= proc(n)
m:= floor(log[10](n));
A:= Array(1..m);
end proc:

I get the error "Error, (in CodeGeneration:-IssueError) cannot analyze non-integer range boundary m". 

Could you please assist me in overcoming this problem? Many thanks in advance. 

Dear friends,

I have a given number and I need to convert its digits into an array. For example: 

a:= 456;  and I need an array [4 5 6]. 

I know how to obtain such a procedure as a list

map(parse, StringTools:-Explode(convert(a, string)));

but not how to get the result as an array. Could you please help me with the right commands?

Many thanks for the help. 

Dear friends, please I would like to ask for your help with the following problem: 

I have to compute some linear programming calculations. I thought it would be a good idea to perform them employing a parallel code. However, much to my surprise, the parallel code is slower than the single-threaded one. I enclose a worksheet sketching both codes with an example. Would you please tell me what it could be wrong with my code? 

Many thanks for your help.EXAMPLES.mws 

Dear friends, please I would like to ask for your help with an odd problem I have using the remove command. 

I have an array 

A:=Array([1,4,1,7]);

and I need to remove its first element A[1]. 

A:= remove[flatten](x -> x = A[1], A);

Instead of getting the result  A:= [4 1 7] I get  A:=[4 7], and I can't understand why. 

Could you please help me with a solution to the problem? Many thanks for the help.  

 

Dear friends, please I would like to ask for your help with the following problem: 

I have a remember table generated by a recursive procedure

x:= proc(n)
option remember; 
....
end proc:

It helps compute x(1), x(2), x(3), x(4). 

After several additional steps I have a new x(2), say 

x(2):= 3; 

With this new x(2) I need to recompute x(3), x(4). I've tried 

forget( x, [ x(3), x(4) ], subfunctions = false ); 

x(3); 

x(4); 

However, I do not get the new values of x(3) and x(4) but the old ones. What could it be wrong? 

Many thanks for your help.  

1 2 Page 1 of 2