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.
09-24-2011 12:00 PM
Solved! Go to Solution.
09-24-2011 12:10 PM
Can you explain more clearly?
What is the array you are starting with?
I don't know what you mean by "guessing/calculating in your brain". We're not mind readers, so we can't guess what is going on in your brain.
09-24-2011 01:30 PM
i did a misstake with the summrize in the metrix (i added a fixed VI).
the elements i get comes in 1D array. in my front pannel i set the array size and the value of the elemnts. the size and value are variables.
"guessing/calculating in your brain".
lets say... i have wood beams. every wood beam size is 4.1 meter and i want to slice from every beam diffrent sizes (like in the 1D array, a slice of 2 meter, of 0.76 meter, of 1.5 meter...).
i want to sum several elements/slices and the result would be as near as possible to L=4.1, also i want to remain with as much as possible of leftovers.
2+2+0.1=4.1
0.76+1.6+1.6+0.1=4.06
0.76+0.76+0.76+1.5+0.1+0.1=3.98
1.5+1.5+0.76=3.86
1.5+1.5+0.76=3.86
0.76+0.76=1.52
09-26-2011 11:38 AM
Hi asaf,
I just read over this and got your VI. Are you still having an issue with this?
I'm still a bit unclear on what you are trying to do. In order to clarify this, I opened your VI using LabVIEW 2011, but I see that you have a broken wire. I'm not really sure what this is for. I see that you're using the summarize all elements in the array VI. This function will take everything in your array (in this case, the array fo 21 elements) and will return the value of the sum. If your goal is to feed this into a matrix of 2Darray, you can just use the "Insert Into Array" function.
I think it would help to go back to the original problem statement and clarify some things from it. From a really high level, you said that you have an array of 21 elements that you want to manipulate. How are you wanting to manipulate it. I see the sums are supposed to end up in the matrix, but what determines what row/column it goes in? I think it will help for you to use the various array functions that can be found by right clicking on the block diagram » Programming » Array.
This Development Zone Article shows a bit on how to create arrays and clusters. It explains a bit more about the various array functions. You could also try using the context help or clicking "detailed help" in that window to find out more about the function.
Hope this helps!
09-26-2011 12:55 PM
You have described the classic "Cutting Stock" problem. To help us help you we need to know if this is homework or if you work in a sawmill.
The following site is very useful, I am sure you can search for cutting stock and find more info: