Combining 2d arrays
Hey all,.
I try to combine 4 u8 berries that have been segmented from an image. It is divided Horiz and vertically. I was able to do this with a math script node, but it is very slow (200-600 ms). Anyone got any ideas how I can do this faster? I thought do in c, but I don't want to use the dll. Any suggestions would be greatly appreciated. In addition, I have that LV 8.2.1.
Thank you
Matt
THX Ravens Fan, I was able to get it down to 1-2 ms. Just did a build up and down left to right, then transposed, build once again and then transpose. Thx again.
Matt
Tags: NI Software
Similar Questions
-
Combining 2D arrays which are FOR output in another 2D array LOOP?
Each iteration of my table of gererates a 2D of loop, with two columns, several rows, same positions
Iteration1 Interation2 Iteration3 etc.
A B A B A B
1 2 3 4 5 6
7 8 9 10
Desired output:
A AND B
1 2
7 8
3 4
5 6
9 10
I have tried to put the table to build inside the loop, the loop, played with cancatenate and add options and try to thread
the result of each iteration of the for loop with auto-index out tunnel enabled (obtain table 3D ). Nothing seems to give me
what I want. I must be missing something simple. Can you please help? Note that the headers A, B will appear once in the desired direction
output and data are cancatenated.
Just a side: each iteration is data read from an Excel sheet. I have several sheets of Excel spreadsheets in a local drive, tested each containing data of a part.
My goal is to combine data from these Excel spreadsheets and put them in a data file and download them in an equal of Oracle for data mining.
I'm going on this problem the right way? Should I combine all the data first and then load them in Oracle, or should I download a file to
a time? I have database connectivity Kit. BTW, when you asnwer the questions, please remember to solve my original problem also
Thanks again!
Thank you. I think that should solve my problem.
-
How to combine two tables: table of origin and its values of interpolation table
We get a new array of values after using the interpolation on a table function in labview, but how to combine the array of values and this original interpolated set of values in a single table?
-
Hi all
1. I want to combine two matrices with the help of the loop.
2 remove duplication
Combine myParray and myCarray.
~ var myFinal = myParray.concat (myCarray)
~ alert ("myFinal:" + myFinal)
var myDoc = app.activeDocument; var myPStyles = myDoc.allParagraphStyles; myParray = new Array(); for(i=0; i<myPStyles.length; i++) { myParray.push(myPStyles[i]) } alert("myParray: " + myParray) var myCstyles = myDoc.allCharacterStyles; myCarray = new Array(); for(k=0; k<myCstyles.length; k++) { myCarray.push(myCstyles[k]) } alert("myCarray: " + myCarray) //Combine Two Arrays for(i=0; i<myParray.length; i++) { for(k=0; k<myCarray.length; k++) { myParray[i].push(myCarray[k]) } } alert("myFinalParray: " + myParray) //Need output here
Thank you
Beginner_X
var doc = app.activeDocument, psNames = doc.paragraphStyles.everyItem().name, csNames= doc.characterStyles.everyItem().name, allNames = [], allNames0 = {}, z = 0, n, lp = psNames.length, lc = csNames.length; while (lp--) allNames0[psNames[lp]] = psNames[lp]; while (lc--) allNames0[csNames[lc]] = csNames[lc]; for (n in allNames0) allNames[z++] = allNames0[n]; allNames.reverse(); alert (allNames.join("\r"));
-
Input array allocated by the function even if it is not
I set it up to call the foalT table 4 times to combine with different results. foalT is a multidimensional array with each element of the element 4 long. It works perfectly the first time that the function is called foalTotal is correct. Other times foalT is empty. It seems that the problem happens when I use original.shift () and then call them recursively function but I have no idea why original happens in the foalT table. Any help would be appreciated.
var foalTotal:Array = handset (foalWA, foalT);
var foalTSC:Array = Combine(foalWASC,foalT);
var foalTDC:Array = Combine(foalWADC,foalT);
var foalTBC:Array = Combine(foalWABC,foalT);
Function Combine(cross:Array,original:Array):Array {}
var k: uint = 0;
total var: Array = new Array;
trace ("foalT length:" + original.length);
If {(original.length!==0)}
for (var i: uint = 0; i < cross.length; i ++) {}
for (var j: uint = 0; j < = 3; j ++) {}
total [k] = cross [i] .slice ();
total [k].push(original[0][j]);
k++;
} //end for
} //end external to
original.shift ();
(Combined (total, original)); return
} //end if
else
return (cross);
{ } / / end fuction
Flex has some degree of use of the references who know you in this case.
As noted in the previous poster, you must clone the object in this case.
-
The data buffer series before transmitting
Hello, I'm relatively new to LabVIEW and had a question about how buffer data to the serial port before transmitting. I've attached what I have so far for a VI, and that's how I expected to work.
- Read in hexadecimal string (example: 001122334455)
- For loop repeats for half the length of the chain because I am transmitting into blocks of size bytes (example: 6F)
- Read the first byte of the ascii string and converts it to hexadecimal equivalent byte and transmits.
- Repeats until the chain is completed.
Basically, I need to place a buffer that fills up my time loop ends then all the data at once. At the moment there is enough of delays between each loop causes errors.
Any suggestions?
everettpattison wrote:
Basically, I need to place a buffer that fills up my time loop ends then all the data at once. At the moment there is enough of delays between each loop causes errors.
Do you mean the while loop or loop for? In the picture, you put the note that you need a buffer inside the loop for, loop not quite awhile. The amount of calculations going on inside this loop is so small that I can't imagine how it is at the origin of the delays, but you can easily replace it to transmit an entire string at a time. Put Scripture VISA outside the loop for. wire the output channel of the conversion at the border of the loop for, creating a tunnel. Connect the output of this tunnel to concatenate strings, which will combine an array of strings into a single string. Then connect to the entry VISA.
EDIT: even better, get rid of the conversion, the U8 to wire directly for the edge of the loop, use the byte array to a string to be converted to a string, send this string to Write VISA. There is probably an even easier approach, but I'm not looking too carefully.
-
Hit testing objects in the table problem
Hey guys, thank you very much in advance for any comments. These forums are a great help.
I have a serious problem with a loop in a table. I'm trying to hitTestObject each MC in a table against all other MC in this table. That part works.
The problem is that in my statement of hitTestObject, so obviously examines only 2 items at a time. When touch 2 MC, I put a property called 'Touch' to true. The problem is they are moving MCs and at one point touching only 2 / 3. What is happening is:
The loop runs once as the test Array [0] and table [1]. Say that those who are affected. She sets their properties 'Touch' true (it's what I want). THEN it works again test Array [1] and table [2] and finds that they are NOT overlapping. It this process it defines two of their properties 'Touch' to false, EVEN IF one of them may overlap a different array object.
I want to individual, set the property to "Touch" for each object in the table. Currently, these properties are getting crushed even if 2 / 3 objects are superimposed in fact.
That makes sense? Essentially the "else" statement is too often called because certain combinations of array objects are not touch, but others are.
-----------------------CODE BELOW-----------------------
stage.addEventListener (Event.ENTER_FRAME, hitTestBalls);
function hitTestBalls(e:Event) {}
for (var m1:int = 0; m1 < MonsterArray.length; m1 ++) {}
for (var m2:int = m1 + 1; m2 < MonsterArray.length; m2 ++) {}
{if (MonsterArray [M1] .hitTestObject (MonsterArray [m2]))}
MonsterArray [m2]. Touch = true;
MonsterArray [m1]. Touch = true;
trace (MonsterArray [m1]. The touching, MonsterArray [m2]. Touch);
trace (M1, m2);
break?
} else {}
trace (M1, m2);
trace ("NotTouching");
MonsterArray [m1]. Touch = false; MonsterArray [m2]. Touch = false;
}
}
}
While waiting for a response, here's something to consider. You don't want to affect the Touching false at any time after that you start the analysis, only front...
function hitTestBalls(e:Event) {}
first put all wrong
for (var m0:int = 0; m0< monsterarray.length;="">
MonsterArray [m0]. Touch = false;
}
now test for overlapping - this way you don't overwrite anything with fake
for (var m1:int = 0; m1< monsterarray.length;="">
for (var m2:int = m1 + 1; m2)< monsterarray.length;="" m2++)="">
{if (MonsterArray [M1] .hitTestObject (MonsterArray [m2]))}
MonsterArray [m2]. Touch = true;
MonsterArray [m1]. Touch = true;
}
}
}
}
And if there be oinky be a pair that overlap as you say, you can add a breakdown; orders to end a loop when a hit is detected.
-
Combining two 1 d arrays in a single 1 d array?
I have two 1 d arrays that look like so:
There is always a zero in one of the paintings, but never both. Is there a way I can combine just the nonzero values in a single table 1 d? Thanks for the help.
chazzchuzz wrote:
I have two 1 d arrays that look like so:
There is always a zero in one of the paintings, but never both. Is there a way I can combine just the nonzero values in a single table 1 d? Thanks for the help.
I can simplify things a bit, but if the arrays are always as shown (the same number of points and always one and only one element matching zero) why not just add them?
Ben64
-
How can I combine a string array and an array of integers?
I have an array of string data [to use as header] and an entire table of multiple column vakues; I need them together in a single file.
Am not able to combine so that I could write them in a single file.
There are several ways you can do. What I recommend is:
- Open the file
- Use the table to a spreadsheet string to transform your headers into a single string
- Write it to the file.
- Use the table to a spreadsheet string to transform your digital data in a single string
- Write it to the file.
- Close the file
-
Combine the elements of a 2D array online
Hi all
I'm pulling in a date column and a column of time since a text file, creating a 2D data table, and then I'm stuck trying to merge the two columns.
For example, I need to take the Date and time the row 0 of the 2D table data are combining in index 0 a 1 d table. Then I need to convert this "timestamp" in seconds. An example is attached.
Any help would be appreciated
Erik
Do you need an array of strings? Which characters will separate the data at the time?
Conversion of seconds using the time of LabVIEW from 12:00, January 1, 1904 is pretty straighforward well that is correctly time and seconds dividers can be difficult. Conversion at any time requires more effort.
Lynn
-
Combine two tables 1 d in a 2D array
Hi all
Maybe I forget what is obvious, but I can't find a solution to combine two tables 1 d in a 2D array AND (it is the impossible part for me) using the tables columns instead of lines.
Example:
Table 1:1, 2, 3, 4
Table 2:5, 6, 7, 8
Result: 1, 5
2, 6
3, 7
4, 8
The 'build array' function seems to add all tables as lines... I guess I could transpose the table, but I want it runs in a Subvi in constructions of different loop and I feel a little uncomfortable with it - I guess one would be left with a completely mixed table. I was maybe blind just to find the right function?
Cheers, Jessi
Hi Jessi,
by default, LV is combining tables in rows. So when you need columns you must transpose the sets or use a different indexing scheme...
-
combine several pl/sql in a single associative array
Hello
I use oracle 10g, can anyone suggest me how to combine several pl/sql in a single Bay.
ex:
I want to combine the data in v_subnasp, v_product, v_order_type to v_combineTYPE t_array IS TABLE OF VARCHAR2 (100) INDEX BY BINARY_INTEGER; v_subnasp pk_rules.t_array; v_product pk_rules.t_array; v_order_type pk_rules.t_array; v_combine pk_rules.t_array;
DeepakDevarapalli wrote:
Sorry, I think that my question is not clear. can I move data from 3 tables on a Bay. and what is the best way. I found a way using loops.If you declare an associative array type - loop is pretty much your only option. If you declare the nested table type, you can use operatots of type multiset:
DECLARE TYPE t_array IS TABLE OF VARCHAR2(100); v_subnasp t_array := t_array(1); v_product t_array := t_array(2); v_order_type t_array := t_array(3); v_combine t_array; BEGIN v_combine := v_subnasp multiset union all v_product multiset union all v_order_type; for i in 1..v_combine.count loop dbms_output.put_line('Element ' || i || ' = ' || v_combine(i)); end loop; END; / Element 1 = 1 Element 2 = 2 Element 3 = 3 PL/SQL procedure successfully completed. SQL>
SY.
Published by: Solomon Yakobson, December 14, 2009 11:19
-
Hello
I've got 7 string tables each containing 5 variables. Is it possible to combine in a single Bay without resorting to the using a separate VI?
Berries, then switch to a vi, at least not the best results because it becomes confused and there are a lot of different result sets > 200.
Any help appreciated.
Rgds,
Sean
Hi Sean,.
To concatenate two tables, you can use the operator +=. For example, locals.a1 += locals.a2.
I hope this will solve your problem, but if you need one more details please let me know.
Kind regards
Thomas Clark
-
combining the subtables in a single array
I am currently using labview 8. And calibration purposes, I needed to break down a sub-table individual table so that each of them could be calibrated individually. From there on, I want to recombine the subtables in a table so that I can datalog. How can I do for this. Please see my attached VI
If you look in the lower right of the while loop I break the table into a set of two sub-tables, and from there I tried to use the VI for construction combine. However, from there I don't know how to proceed. and my final goal it to attach to the VI 'writing on a file' in the structure of the case at the top of the while loop, so that I can save the data.
Kind regards
Michael Sugimura
Of course we only need a knot of "index Board"...
-
All possible combinations of the strings in the array in PL/SQL
Hello
I'm trying to figure out how to build a list of all possible combinations of string values that are stored in a single table.
There are several 'levels' (a level being of the order in which the value appears in the output string) and multiple values per level...
I am using Oracle 10 g R2, and my table structure is as follows:
I want to get results, for the sample data above (using only 3 levels for a reasonable amount of data):--not the best naming conventions, but it works for discussion... CREATE TABLE FamilyValues ( myID INTEGER NOT NULL, FamilyID INTEGER NOT NULL, myLevel INTEGER NOT NULL, myValue VARCHAR2(10) ) insert into familyvalues values(1,1,1,'I',); insert into familyvalues values(2,1,1,'E',); insert into familyvalues values(3,1,2,'2',); insert into familyvalues values(4,1,2,'J',); insert into familyvalues values(5,1,2,'B',); insert into familyvalues values(6,1,3,'0',); insert into familyvalues values(7,1,3,'1',); insert into familyvalues values(8,1,3,'2',); insert into familyvalues values(9,1,3,'3',); insert into familyvalues values(10,1,3,'4',); insert into familyvalues values(11,1,3,'5',); insert into familyvalues values(12,1,3,'6',); insert into familyvalues values(13,1,3,'7',); insert into familyvalues values(14,1,3,'N',); insert into familyvalues values(15,1,3,'T',); insert into familyvalues values(16,1,3,'V',); insert into familyvalues values(17,1,3,'W',); insert into familyvalues values(18,1,4,'0',); insert into familyvalues values(19,1,4,'1',); insert into familyvalues values(20,1,4,'2',); insert into familyvalues values(21,1,4,'3',); insert into familyvalues values(22,1,4,'4',); insert into familyvalues values(23,1,4,'B',); insert into familyvalues values(24,1,4,'D',); insert into familyvalues values(25,1,4,'F',); insert into familyvalues values(26,1,4,'H',); insert into familyvalues values(27,1,4,'J',); insert into familyvalues values(28,1,4,'K',); insert into familyvalues values(29,1,4,'L',); insert into familyvalues values(30,1,4,'M',); insert into familyvalues values(31,1,4,'N',); insert into familyvalues values(32,1,4,'P',); insert into familyvalues values(33,1,4,'R',); insert into familyvalues values(34,1,4,'T',); insert into familyvalues values(35,1,4,'V',); insert into familyvalues values(36,1,4,'W',); insert into familyvalues values(37,1,4,'X',); insert into familyvalues values(38,1,4,'Y',); insert into familyvalues values(39,1,4,'Z',);
so far my best attempt is:I 2 0 I 2 1 I 2 2 I 2 3 I 2 4 I 2 5 I 2 6 I 2 7 I 2 N I 2 T I 2 V I 2 W E J 0 E J 1 E J 2 E J 3 E J 4 E J 5 E J 6 E J 7 E J N E J T E J V E J W
I read on the post to ( but think it is a slightly different implementation...)select A.myValue || '-' || B.myValue || C.myValue || D.myValue from FamilyValues A FULL JOIN FamilyValues B ON (B.myLevel -1) = A.myLevel FULL JOIN FamilyValues C ON (C.myLevel -1) = B.myLevel FULL JOIN FamilyValues D ON (D.myLevel -1) = C.myLevel WHERE A.myValue IS NOT NULL AND B.myValue IS NOT NULL AND C.myValue IS NOT NULL AND D.myValue IS NOT NULL
I wish I could recusively pass by the table and make all possible combinations with each of the values in the table in the positions provided by the level...select ltrim(sys_connect_by_path(myValue,' ')) combination from familyvalues where connect_by_isleaf = 1 start with myLevel = 1 connect by FamilyID = prior FamilyID and myLevel = prior myLevel + 1 / COMBINATION -------------------------------- I 2 0 0 I 2 0 1 I 2 0 2 I 2 0 3 I 2 0 4 I 2 0 B I 2 0 D I 2 0 F I 2 0 H I 2 0 J I 2 0 K I 2 0 L I 2 0 M I 2 0 N I 2 0 P I 2 0 R I 2 0 T I 2 0 V I 2 0 W I 2 0 X I 2 0 Y I 2 0 Z I 2 1 0 I 2 1 1 I 2 1 2 I 2 1 3 I 2 1 4 . . .
SY.
Maybe you are looking for
-
Can you connect two cable on wifi networks?
Basically, I'm trying to build it. It was much easier in photoshop than to the fact of installation. There are many features, some wired, some wireless. I ran son where I can run threads, but it's a bit more difficult that I thought for a domain. B
-
Windows XP WinZip password, can it be reset or deleted?
Help - got rid of the trial version of .rar - but can't open a zip file due to a password that must be entered, and I do not know it... help?
-
Hello because 2 months I am developing an application, I'm stuck in one or other problems. I'm this difficukt because I have not basic java, I know nothing, as java application mobile e.t.c May I be question is stupid... don't answer me if it's so si
-
Unable to connect to the servers Cloud Creative
I try to install creative cloud, I had the installer stuck on 'Try to connect to the server' for 9 hours during the night and he has made no progress on the download either.
-
A file corrupt vmdk - VD: error VERR_VD_VMDK_INVALID_HEADER
I recently had my VM accident and when I went to reboot the virtual machine, I received the information below.I tried to mount the drive but no luck, I got the same message.Help to recover the vmdk will be greatly appreciated.ERROR MESSAGE:Failed to