From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
10-19-2013 02:49 AM
Hey im trying to sort 1D array into two different arrays i.e. Even array and odd array.. please help me out..
10-19-2013 03:16 AM
Hello T_reX, and welcome to the forum.
To start off- what have you attempted already? Do you have code that you are trying to modify, or is this a new project? Where is your data coming from, and what format is it in - integers, double-precision floating point decimal values, strings? How many values do you need to process?
If you're working with integer values, the quotient & remainder function is very handy for determining whether or not a number is even or odd- use 2 as an input for Y and the remainder will tell you if the integer is even or not.
Regards,
10-19-2013 03:53 AM
Here
10-19-2013 04:12 AM
Wow Ranjeet......Nice Answer ( May be I am wrong that question is not very clear ).
and here we all are trying to tell new users dont use locals, what is auto indexing for loop, why and when not to use functions like insert array blah blah.......
10-19-2013 04:15 AM
After posting , i saw that your reply marked as solution
he got what he needed and after few years with same habit he will be developing big projects and abusing LabVIEW.
10-19-2013 04:19 AM
man plz don't get me wrong... but i got what i was looking for ... no need to fight on that topic now..
thank you...
10-19-2013 04:23 AM
There you go.
Best of luck
10-19-2013 04:27 AM
@Neos wrote:
Wow Ranjeet......Nice Answer ( May be I am wrong that question is not very clear ).
and here we all are trying to tell new users dont use locals, what is auto indexing for loop, why and when not to use functions like insert array blah blah.......
There are thousand way to do this. I did this way. Access of anything is bad(and so is local variable). Using local variable is not a crime.
10-19-2013 07:25 AM
10-19-2013 09:11 AM - edited 10-19-2013 09:25 AM
@T_reX wrote:
man plz don't get me wrong... but i got what i was looking for ... no need to fight on that topic now..
Nobody is fighting, we are just having your best interest in mind.
You'll be well advised to basically ignore that solution and find something a bit more reasonable. if you learn LabVIEW this way, you'lll have unsurmountable problems later when the task gets just a little bit more complex. Bad habits are hard to break so learn the right way with simple problems from the beginning.
This seems to be homeweork. As a teacher I would give that solution a failing grade (minimal credit for giving the right result but with huge deductions for horrible coding style).
Now go back to an empty diagram, start from scratch and do something that does NOT have local variables.
In your future job you might have to deal with large arrays. In this case, the given solution will be many orders of magnitude slower and less efficient. It could take minutes to do what better code could do in milliseconds. Yes! Really!!! Coding style like this could get you fired in most places of work. 😞
See what you can come up with and post it here so we can help you improve further. This is a trivially simple beginners problem, so do your best. Shouldn't take more than a few minutes to modify. Try it! Good luck!