Subtraction

Hello Guys,

I have a question that I’d be happy if you could assist :

I got a matrix A . I want to subtract it from matrix B and then give the final result to B;mean B=B-A

Waiting to hear more from YOU :slight_smile:

THX,
Amir Ghods


To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/RHpppOFhYogJ.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Hello,

I guess you could define matrix A(i,j) and B(i,j). Then BB(i,j) as follows:.

Say BB(i,j) = B(i,j) - A(i,j)
Finally
B(i,j) = BB(i,j).

If this doesn’t work you could try a loop.

Hope this helped

Regards

On Sun, Jul 8, 2012 at 7:51 AM, Amirhossein Ghods
wrote:

Hello Guys,

I have a question that I’d be happy if you could assist :

I got a matrix A . I want to subtract it from matrix B and then give the
final result to B;mean B=B-A

Waiting to hear more from YOU :slight_smile:

THX,
Amir Ghods


“gamsworld” group.
To view this discussion on the web visit
https://groups.google.com/d/msg/gamsworld/-/RHpppOFhYogJ.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to
gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/gamsworld?hl=en.

\

set i /i1*i3/;
alias (i,j);

parameter A(i,j), B(i,j);

loop(i,
loop(j,
A(i,j) = uniform(0,10);
B(i,j) = uniform(0,10);
);
);
display A,B;
B(i,j) = A(i,j) - B(i,j);
display B;

/Örjan

Date: Sat, 7 Jul 2012 22:51:30 -0700
From: amirhossein.ghods@gmail.com
To: gamsworld@googlegroups.com
Subject: Subtraction

Hello Guys,

I have a question that I’d be happy if you could assist :

I got a matrix A . I want to subtract it from matrix B and then give the final result to B;mean B=B-A

Waiting to hear more from YOU :slight_smile:

THX,
Amir Ghods


To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/RHpppOFhYogJ.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.