Skip to main content
1-Visitor
June 27, 2018
Question

Conditioned multiplication of numbers in Matrix

  • June 27, 2018
  • 3 replies
  • 2304 views

Hello,

 

I would like to multiply only certain numbers in a matrix. Only numbers lower than a certain variable. 

Lets say I have a 1x5 matrix [23 12 89 44 8] and I want to multiply all numbers less than 30 (in the matrix) by 2. 

New matrix would output the following:

 

[46 24 89 44 16]

 

Can someone point me in the right direction...

 

Thanks!

3 replies

19-Tanzanite
June 28, 2018

As follows:

 

 selectmultiply.PNG

 

 

 

 

 

 

Alan

21-Topaz II
June 28, 2018

es kann auch klassisch gemacht werden ....

OO.jpg

IRarch1-VisitorAuthor
1-Visitor
June 29, 2018

Thank you so much, this worked perfectly...

25-Diamond I
June 28, 2018

OK, so here's a third variant

b.PNG

and here a further "classic" one turned into a function

b2.PNG