Helen,
I think you may be using insert into array when you should be using replace
array subset. This second method will automatically resize it's inputs if
you wire a 2d array to it. then you just need to give it the size and offset
of both dimensions and it will insert your data into a zero initialized array
right where you want it. In one operation.
Jared
"Helen E. Kourous" wrote:
>That's what I meant when I said the "insert into array" just strings my
first>array out into a VECTOR then inserts at the specified index. Hmm. Maybe
I'm>doing something wrong, or should try it within a FOR loop...>I'll look
at it. Thanks!>>henk hessel wrote:>>> Have a look at the new LV6i array primitives:
Insert into array, and:>> replace array subset.>> They both will solve your
problem, I think. Just insert/replace your array>> into a 2D array of zeroes.>>
Have fun>>>> Helen E. Kourous wrote in message>>
news:3A37824F.AB84A575@erim-int.com...>> > Thanks to everyone - I should
have specified I have a 2D array. Not only>> do I>> > have to pad on either
side, but I have to add slices of "bread" zeros on>> top>> > and bottom.
(in fact I found a ZeroPad vi in Signal Processing which>> appends>> > zeros
to a 1D array to the next highest power of 2...).>> >>> > Looks like I'll
stick to my 5-step approach... althought I could do the>> "meat">> > part
with a for loop as you say.>> >>> > Hmmm! A one-liner in matlab! Oh well...>>
>>> > Sam Shearman wrote:>> >>> > > Helen:>> > >>> > > Another technique
would be to append an initialized array of zeros to>> the>> > > array of
points you want to zero pad. Use a length N array of zeros>> where N>> >
> is the total number of zeros you want to pad (both sides of the>> sandwich).>>
> > You now have an array that has the original signal with N following>>
zeros.>> > > If you now use the Rotate 1D Array VI (on the array palette)
to rotate>> the>> > > array by the number of elements that you want to pad
on the beginning of>> > > the array.>> > >>> > > Sam Shearman>> > > Product
Manager, Signal Processing & Analysis Software>> > > National Instruments>>
> >>> > > greenman_11_11@my-deja.com wrote in <915d3v$dp8$1@nnrp1.deja.com>:>>
> >>> > > >Helen:>> > > >>> > > >If you know the total size of your array
in advance, you can create an>> > > >array of all zeros using the "intialize
array" function, and then>> > > >replace a portion of it using the "replace
array element" function>> > > >inside of a for loop. Use a shift register
on the loop and intiialize>> > > >it with the array of zeros. Index your
array of "meat" at the boundary>> > > >of the for loop and feed it into the
"element data" input of the>> > > >replace function. If your "meat" array
is of indeterminate size, your>> > > >probably better off using the "build
array" function. If you have any>> > > >more questions on using the Replace
Array Element function, email me.>> > > >>> > > >Max>> > > >>> > > >>> >
> >>> > > >In article <3A34E688.9C715F4B@erim-int.com>,>> > > > "Helen E.
Kourous" wrote:>> > > >> Am I missing the easy way
here? To zero pad a complex or float>> array,>> > > >> do I really need
to concatenate 5 subarrays together? (ie the top>> > > >> "sandwich bread"
of zeros, the middle "meat" consisting of zeros on>> > > >> either side of
my original array, and bottom slice of zeros)?>> > > >>>> > > >> Embedding
arrays seems to involve embedding a given 2D array strung->> > > >out>> >
> >> as a line vector within the destination array at the input index. Is>>
> > >> there a 2D embed? Or perhaps I'm scared of For loops and arrays!>>
> > >>>> > > >> Thanks in advance,>> > > >> Helen>> > > >>>> > > >> -->>
> > >>>> > > >> Helen E. Kourous>> > > >> Research Engineer - Veridian ERIM
International>> > > >> NO SPAM PLEASE>> > > >>>> > > >> ...and the Grinch
with his Grinch feet ice cold in the snow, stood>> > > >> puzzling and puzzling
- how could it be so? ... He puzzled and puzzed>> > > >> till his puzzler
was sore. Then the Grinch thought of something he>> > > >> hadn't before.
Maybe Christmas, he thought, doesn't come from a>> store.>> > > >> Maybe
Christmas, perhaps, means a little bit more.>> > > >>>> > > >>>> > > >>>
> > >>> > > >Sent via Deja.com http://www.deja.com/>> > > >Before you buy.>>
>>> > -->> >>> > Helen E. Kourous>> > Research Engineer - Veridian ERIM
International>> >>> >>> > ...and the Grinch with his Grinch feet ice cold
in the snow, stood>> puzzling and>> > puzzling - how could it be so? ...
He puzzled and puzzed till his puzzler>> was>> > sore. Then the Grinch thought
of something he hadn't before. Maybe>> Christmas,>> > he thought, doesn't
come from a store. Maybe Christmas, perhaps, means a>> little>> > bit more.>>
>>> >>>-->>Helen E. Kourous>Research Engineer - Veridian ERIM International>PH
(734) 994 1200 x2941 (FAX 5124)>http://www.erim-int.com/>>....and the Grinch
with his Grinch feet ice cold in the snow, stood puzzling and>puzzling -
how could it be so? ... He puzzled and puzzed till his puzzler was>sore.
Then the Grinch thought of something he hadn�t before. Maybe Christmas, he>thought,
doesn�t come from a store. Maybe Christmas, perhaps, means a little bit>more.>>