Skip to main content
10-Marble
April 27, 2018
Solved

If Statement with Three Ranges (REPOST WITH M15 FILES)

  • April 27, 2018
  • 2 replies
  • 2512 views

I was getting a few of views on this but no replies (I'm assuming) because my files were in Prime 4.0.  I've added some more files viewable without 4.0.

 

I'm having trouble creating a program with an if statement that has three ranges, i, j, & k.  Results would be a matrix with k submatrices each with i rows and j columns.  See attached.  

Best answer by Werner_E

Something like this?

B.png

2 replies

Werner_E25-Diamond IAnswer
25-Diamond I
April 27, 2018

Something like this?

B.png

23-Emerald I
April 27, 2018

Either you're too fast or I'm too slow!

 

Very neat use of vectorization!

25-Diamond I
April 27, 2018

The data structure of M,N and X looks rather unnecessary blown up.

Maybe something more simple would do the job as well:

B.png

 

If for some reason you really need those structures M, N you could easily create it using one of the following methods:

B2.png