optimizing macro for many iterations
Hi all
I have a question regarding writing a simple macro. What I want to do is to construct matrices from two paired 1D waves (total four 1D waves).
I want to do something like this…
For example, there are four 1D waves (1A, 1a, 2B, 2b) in which 1A&1a and 2B&2b are paired respectively, and each wave is composed of values determined by the rules below.
- 1A, 1B: sequential increment from 1 to 1,000,000
- 1a, 1b: random value between 1 and 4096
Thus, the size (dimension) of each wave is 1,000,000.
1A |
1a |
2B |
2b |
1 |
0 |
1 |
500 |
2 |
1000 |
2 |
3000 |
3 |
4095 |
3 |
10 |
⇣ |
⇣ |
⇣ |
⇣ |
For each specific difference between 1A and 2B, I want to make 2D histograms in which X and Y coordinates correspond to components associated from 1a and 2b. After 1,000,000 x 1,000,000 iterations, the size of the final output wave would be 4096x4096x999,999. It may take too much time to complete this procedure because of too many iterations. is it possible to complete this procedure in Igor? I would really appreciate any feedback on this matter.
Thank in advance.
Best wishes,
YC
I don't fully understand what you are trying to do. In answer to your question, it is possible to do this in Igor and those are not too many iterations you are talking about. From what I understand it is possible to write your function in a more simplified way so that you don't need to iterate so much. Some advice:
July 25, 2018 at 01:42 pm - Permalink
4096x4096x999,999 = 1.67772e+13 is much too large for a wave.
July 25, 2018 at 02:53 pm - Permalink
In reply to 4096x4096x999,999 = 1.67772e… by johnweeks
Oh yes, didn't think of that. Limit is 2.147 x 10^11 points.
July 25, 2018 at 03:11 pm - Permalink
I sincerely appreciate those tips to make a better macro. I think I can figure it out. Thank you again.
July 25, 2018 at 04:17 pm - Permalink