Veeru wrote:
I have a two 1D arrays,(size for example 5elements),I hve to split each element separately and find the maximum and minimum of that element.
I have the fig of my program.
OK, it seems you want to keep the current max and min in a shift register. You have a serious logical flaw and are also doing things way too complicated.
First of all, the shift registers need to be initialized with "-inf" and "inf" respectively, not zero! For example if asll your numbers are >0, your min would be stuck at 0 instead of the real min value.
The comparison can be done with the max&Min primitive (from the comparison palette). This is much simpler than your comparison and select constructs.
Here's a quick draft. Modify as needed.
Of course this kind of code is more useful if you have a while loop that runs for extended periods This way you don't need to accumulate huge arrays as would be the case in some of the other suggestions here.
Message Edited by altenbach on
06-12-2008 08:40 AM