Items tagged with assign assign Tagged Items Feed

I have no idea where to start with this problem.

I know how to create arrays, but I want to assign characteristics to each position in the array; the array being a population with each member having a set of characteistics like height, weight etc. I want to be able to have some of the characteristics able to change with time, and some remain constant (those that change with time will be defined by generic equations)

I have tried looking on maplesoft for answers, and the help within maple 16, but have been unable to make any progress.

 

Sorry if the question is not specific enough.

 

Thanks in advance x

I need a small help again. I have a basic question. Not able to figure how to do this.
(I am a newbie in Maple)

Maple handles things little different inside a proc() vs. global. http://www.maplesoft.com/support/help/Maple/view.aspx?path=procedure

And I could not understand what this below means in plain English:

Within a procedure, during the execution of its statementSequence, local
variables have
single level evaluation. This means that using a variable
in an expression will yield the current value of that variable, rather than
first evaluating that value. This is in contrast to how variables are evaluated
outside of a procedure, but is similar to how variables work in other programming languages.

 

But here is my question. In global name space, A variable inside an expression will automaticaly
update to the current value of the the variable. So one can do this:

x:='x';z:='z';
expr:=3*z;
z:=solve(x-1=0,x);
expr;

and now expr will have value "3" and not "3 z" since "z" was assigned a new numerical value in between
as one can see. The same code inside a proc()  behave differently

f:=proc()
  local z,x,expr;
  expr:=3*z;
  z:=solve(x-1=0,x);
  expr;
  end proc:

f();

return "3 z" and not "3" as the case with global scope. I tried subs() insid the proc,
but still it did not work. What is the recommded way to handle this? I want "expr" to
use the most recent value of any variables inside it. I can't do sub(z=z,expr) ofcourse
since this makes no sense. I need the value of z inside expr to be updated.i.e. I need
to refresh "expr" somehow.

 thank you,

Hello Maplers, i have encountered a little annoyance with Maple, that i would like to ask, whether it can be solved. 

 

It's when i try to define a function, like f(x)=2x and try to define it with a command f(x):=2x, a pop-up box comes up, asking me whether i'd like to use a 'function definition', or 'remember table assignment', and i would like to make Maple remember my choice that i want a function. 

 

I know i can write it like f:=x->2x, but i hate to look at that, to be frankly..

 

So, is there any way to solve this?

 

Hi.

I'm having a problem with this little guy "cos(Phi1(x)-psi)". When printed, it becomes "cos(-Phi1(x)+psi)", when Maple does not know what Phi1(x) or psi are. No matter what sign i set for psi, it will only display +psi when printed. Anyone know what causes this?

Is it possible to assign a matrix given values/expressions?

Instead of assigning each element separately like in the example below:

maple_example

Hello,

I would like to assign a value I got from using the command 'Maximize'. What I gained as an answer is of the following form:
test:=[1234124, [t=124124124]] 

Now my point is to assign both these values to variables, which I can do for the first like:
first:= test[1];

But I just can't find out how to assign the second value.
I was trying it out by using the command 'rhs' but that doesn't work (although, not for me).

Probably a silly question, but yeah..thanks for a reply.

Frank 

Hello, Is there a way to assign mutiple variables at once using the 'if-then' statement?For example: if A:=3, then B:=434 and C:=52 and H:=2039So that I fill in these variables B, C and H one time and then when A is chosen to be a value, all other values are assigned automatically. Like filling in a table actually.In a simple 'if-then' statement I assign one variable, which works well.a:=10if a:=10 then b:=4elif a:=20 then b:=3end if:b ends up being 4I don't know how to add variable C and H, without getting an error.It should be very simple in my opinion, but I just don't see it.Greetings,Frank

I've found a fundamental difference in the use of 

G2:=CopyGraph(G):
and
G2:=G:

where G is a Graph in the GraphTheory package.

 

If I change G2 in the first case, G remains the same.

If I change G2 in the second case, G changes together with G2.

(The same happens when G is an input parameter in a procedure. Normally formal parameters cannot be changed, but if G is a graph there is no error message when changing G). 

I am doing an algorithm that include a " for " loop, inside that loop in the first statement I assigned a certain matrix to a variable G and then the algorthim changes some elements in G but when the algorithm repeat the second step of the loop it uses the last resulted matrix of the previous step NOT the one that is defined in the first statement of the loop. I want it to start each step of the loop with the same value of the matrix. what should I do?


 

Download posi1_-_Copy.mw 

 

hey primes please i need help. i´m trying to create a procedure capable to find an arbitrary distance. at some point in loop clause, is important to 'unassigned'  the variables solved and here where i have problem. it work fine in...

I am getting the reecursive assignment error on the folowing code in the band[i]:= [band[]i[], ... section.

CreateMatrix is defined and I know that works and creates a global Matrix H

Hello,

 

I am trying to solve 9 non linear equations in 3 do loops(program attached without loop) and I am using digits:=20; for computing 10 values its takes around 5 minutes. I need to compute around 18000 such values for a plot. It might take several days for this. Is there any mistake in my code which is taking it so long to run or is it just the complexity of the equations.

 

Secondly, I am trying to compute some calculations to...

Hello,

How can I use assign(...) inside in proc in order to affect the local variables and not the globals.

 

Thanks

Hi!

I'm wondering how to substitute eval(diff(P(x, tau, p), p), p = 0) in the equation below with v[1](x, tau)

 

I have Zipped 2 equations together to equate their equivalent Coefficients.  I now need to assign solve the list fot each value of N (1...9) How do I get Maple to do this reliably for the list as N 1..9 does not necessarily occour in sequence.

1 2 3 4 5 6 7 Last Page 1 of 23