Group Abstract Group Abstract

Message Boards Message Boards

0
|
2.6K Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Apply a function to matrix elements?

Posted 6 years ago

Hello, I'm trying to apply a function to all of the elements of a 2D matrix. The catch is that the some of the function inputs are other elements of the matrix. In other words, the function to calculate the element in row 3, column 4 uses the values in row 2, columns 3 - 5.

This is easy to do with procedural programming (loops), but I'm trying to do it using functional programming techniques.

Thanks, Tony

POSTED BY: Tony Marino
2 Replies
Posted 6 years ago

Thanks Rohit. I'll look into cellular automata.

POSTED BY: Tony Marino
Posted 6 years ago

If the function does not use the value of an element to compute a new value then it does not seem like Map is the right function to use. From the pattern described maybe you are trying to implement an elementary cellular automata?

POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard