Remove multiples from array

Hello, 
I am trying to remove multiples of a fundamental frequency from an array of frequency points.  One extra issue with this removal, is that the multiple of the fundamental frequency from the array may be within a range, like +/- 1k.  Any help will be greatly appreciated.
Thanks,
hiNi.
Solved!
Go to Solution.
Attachments:
delete rows 2.vi ‏13 KB

Give this a try.  You want to look at the remainder and then setup a couple of ranges based on the accuracy you want.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
Attachments:
delete rows 2.zip ‏6 KB

Similar Messages

  • Remove Entry from Array

    Hi,just another question. Is it possible to remove an entry inside an Array without splitting up by using SubSet und with a combine after that? I found no function for that way...RegardsHenrik

    Henrik Skupin wrote:
    > Hi,
    >
    > just another question. Is it possible to remove an entry inside an
    > Array without splitting up by using SubSet und with a combine after
    > that? I found no function for that way...
    The new LabVIEW 6i has a "Delete from Array" VI that will do this more
    elegantly.
    Regards,
    John Lum

  • Remove repetitions from array

    Hi
    I would like to know how to remove repeitions from a 1D array. For example, AAANNNNDDDDKLL to ANDKL.
    Also, what if the array is not sorted?
    Arjun

    I have used this one in the past.  But if anybody has a more memory effecient way to do it I would be happy to hear it.
    Attachments:
    RemoveDups.vi ‏8 KB

  • Remove element from array

    hi
    if i have an array
    eg
    int[] array = {4,2,1,2,1};
    how to i remove the index 2 from it and create a new array?
    thanks

    You can't remove the element--an array's size is fixed at creation.
    If you want a new array, create a new one that's one element smaller, then use System.arrayCopy to copy the elements you want to keep.

  • Error #2025:The supplied DisplayObject must be a child of the caller - Removing Object from Array

    Hi guys, I'm pretty new to as3 and I'm trying to make a game where the player supposedly clicks on the stage and 3 towers which I've spawned dynamically should shoot towards the area. Everything works in terms of tower rotation, etc, but the bullets will not be removed from the stage when I exit the level into another scene. The boundary checking is fine, too.
    Here's a part of the code in the Main.as file.
    private function clickTower1(e:MouseEvent):void
    for each (var tower1:mcTower1 in tower1Array)
    var newLaser1:mcLaser1 = new mcLaser1();
    newLaser1.rotation = tower1.rotation;
    newLaser1.x = tower1.x + Math.cos(newLaser1.rotation * Math.PI / 180) * 40;
    newLaser1.y = tower1.y + Math.sin(newLaser1.rotation * Math.PI / 180) * 40;
    newLaser1.addEventListener(Event.ENTER_FRAME, laser1Handler);
    tower1BulletArray.push(newLaser1); stage.addChild(newLaser1);
      private function laser1Handler(e:Event):void
    //Make laser move in direction of turret.
    var newLaser1:MovieClip = e.currentTarget as MovieClip;
    newLaser1.x += Math.cos(newLaser1.rotation * Math.PI / 180) * laser1Speed;
    newLaser1.y += Math.sin(newLaser1.rotation * Math.PI / 180) * laser1Speed;
    //Boundary checking if (newLaser1.x < -50 || newLaser1.x > 800 || newLaser1.y > 600 || newLaser1.y < -50)
    newLaser1.removeEventListener(Event.ENTER_FRAME, laser1Handler); stage.removeChild(newLaser1);
    tower1BulletArray.splice(0, 1);
    I have a function called exitLevel, which basically, as the name states, exits the level when a button is clicked. It worked perfectly before I started coding the bullets.
        private function exitLevel(e:MouseEvent):void
    stage.frameRate = 6;
    gamePaused = false;
    clearLevel();
    gotoAndStop(1, 'exitLevel');
    btnExitLevel.addEventListener(MouseEvent.CLICK, levelSelect1);
      private function clearLevel():void
    stage.removeEventListener(Event.ENTER_FRAME, update);
    stage.removeChild(buttonCreep1); stage.removeChild(buttonCreep2);
    for (var i = creep1Array.length - 1; i >= 0; i--)
    removeChild(creep1Array[i]);
    creep1Array.splice(i, 1);
    //trace ("Creep1 Removed");
    for (var j = creep2Array.length - 1; j >= 0; j--)
    removeChild(creep2Array[j]);
    creep2Array.splice(j, 1);
    //trace ("Creep2 Removed");
    for (var k = tower1Array.length - 1; k >= 0; k--)
    removeChild(tower1Array[k]); tower1Array.splice(k, 1);
    for (var l = tower1BulletArray.length - 1; l >= 0; l--)
      stage.removeChild(tower1BulletArray[l]);
    tower1BulletArray.splice(0, 1);
    After debugging, it says the error is at the end, where i try to remove the child from the stage. What is wrong? Sorry, I'm a beginner at as3 so any answers might have to be spoonfeeding... I'll try to learn and understand, though. Thanks!
    I did take some of the code off of a guide on the web, and I don't understand it totally, so can someone explain to me what this code does as well? What is e.currentTarget? Thanks!
    var newLaser1:MovieClip = e.currentTarget as MovieClip;
    Here's the full .as file if anybody wants to take a look. http://pastebin.com/5ff4BQa5

    Hi, I managed to solve the errors (kind of) by using this code.
    for (var i:int = tower1BulletArray.length - 1; i >= 0; i--)
    if (tower1BulletArray.parent)
    tower1BulletArray[l].parent.removeChild(tower1BulletArray[l]);
    tower1BulletArray.splice(i, 1);
    However, the problem still persists that the bullets stay in the screen after I change the scene. Any solution? Thanks!

  • Removing Items From Array Collection

    Hi. I have an array collection which is made up of items
    defined in class PlayListEntry. I want to remove all the items that
    have the value of property select set to false. This is what i have
    come up with, it works fine, but only removes half the items at a
    time. I think this is because when you remove and item with
    removeitemat() it shifts the index of the items. How can i get
    around this?
    Code
    private function removeitems():void{
    for each (var ple:PlayListEntry in songCollection){
    if (ple["select"] != true){
    songCollection.removeItemAt(songCollection.getItemIndex(ple));
    }

    Here's a sample application I wrote that achieves what you're
    looking for.
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute">
    <mx:Script>
    <![CDATA[
    import mx.collections.ArrayCollection;
    [Bindable] private var medalsAC:ArrayCollection = new
    ArrayCollection([
    {Country:"USA", Gold:35, Silver:39, Bronze:29, select:true},
    {Country:"China", Gold:32, Silver:17, Bronze:14,
    select:true},
    {Country:"Russia", Gold:27, Silver:27, Bronze:38,
    select:true},
    {Country:"USA2", Gold:35, Silver:39, Bronze:29,
    select:false},
    {Country:"China2", Gold:32, Silver:17, Bronze:14,
    select:false},
    {Country:"Russia2", Gold:27, Silver:27, Bronze:38,
    select:false},
    {Country:"USA3", Gold:35, Silver:39, Bronze:29,
    select:true},
    {Country:"China3", Gold:32, Silver:17, Bronze:14,
    select:true},
    {Country:"Russia3", Gold:27, Silver:27, Bronze:38,
    select:true}
    private function filterItems():void {
    for(var i:Number = 0; i < medalsAC.length; i++){
    if(medalsAC
    .select == false){
    // => Remove item
    medalsAC.removeItemAt(i);
    // => Refresh collection so it see's new change.
    medalsAC.refresh();
    // => Start at beginning and keep looking
    i = 0;
    ]]>
    </mx:Script>
    <mx:Button x="10" y="10" label="Remove False Items"
    click="filterItems()"/>
    <mx:DataGrid left="10" right="10" top="35" bottom="10"
    dataProvider="{medalsAC}">
    <mx:columns>
    <mx:DataGridColumn headerText="Country"
    dataField="Country"/>
    <mx:DataGridColumn headerText="Gold"
    dataField="Gold"/>
    <mx:DataGridColumn headerText="Silver"
    dataField="Silver"/>
    <mx:DataGridColumn headerText="Bronze"
    dataField="Bronze"/>
    <mx:DataGridColumn headerText="Select"
    dataField="select"/>
    </mx:columns>
    </mx:DataGrid>
    </mx:Application>

  • Remove item from Array

    Hi,
    Can i remove a single item in my array or remove all elements???
    Tnx all
    Beck74

    This is a quick way to remove an element. It avoids looping which avoids an ArrayIndexOutOfBounds check with every iteration. Also, arraycopy is native which means that it is very efficient and suitable for large arrays.
    public class arraytest
        public static int[] remove(int _i, int[] _a)
         int[] b = new int[_a.length-1];
         System.arraycopy( _a, 0, b, 0, _i );
         System.arraycopy( _a, _i+1, b, _i, b.length-_i );
         return b;
        public static void main(String[] args)
         int[] a = {1, 2, 3, 4, 5};
         // remove element 3
         int[] b = remove(3, a);
         for( int i=0; i<b.length; i++ ) {
             System.out.println( b[i] );
    }

  • How can I remove multiple copies of the same song from the iTunes listing?

    How can I remove multiple copies of the same song from the iTunes listing. The program seems to be picking up the same songs from, for example, my user area and my public area in the C drive

    As above, Apple's official advice is here... HT2905 - How to find and remove duplicate items in your iTunes library, however it is a manual process and the article fails to explain some of the potential pitfalls.
    Use Shift > View > Show Exact Duplicate Items to display duplicates as this is normally a more useful selection. You need to manually select all but one of each group to remove. Sorting the list by Date Added may make it easier to select the appropriate tracks, however this works best when performed immediately after the dupes have been created.  If you have multiple entries in iTunes connected to the same file on the hard drive then don't send to the recycle bin.
    Use my DeDuper script if you're not sure, don't want to do it by hand, or want to preserve/merge ratings, play counts and playlist membership. See this thread for background and please take note of the warning to backup your library before deduping.
    (If you don't see the menu bar press ALT to show it temporarily or CTRL+B to keep it displayed)
    tt2

  • Removing keyword from multiple images at the same time

    None of the documented methods seem to work for me.
    1     Select all the images. Go to Metadata > Remove Keyword [my keyword] - the keyword is only removed from the image that is selected in the batch - i.e the one that has the yellow border round it to show it's the active image.
    2     Select all the images, enter [my keyword] in the Add Keyword field when Keyword Controls is visible and press Shift + Enter - does the same thing as 1 above (removes it from the active image only).
    3     Select all the images, Shift Click on the keyword that I have in my Keyword Controls in the Control Bar - does the same things as 1 above.
    So all these methods, which are supposed to work, do not work for me. The removal of the keyword is only applied to the image that has the yellow border showing it to be the currently active image in the selected batch - the remaining selected imaged still retain the keyword. I can remove it "one at a a time" but it would be great if I could find a solution as to why this isn't working.
    Any ideas?
    If it helps, I'm running Aperture 3.1.3 in OS X 10.6.8.
    thanks
    Alan

    Based on the frequency with which this trips up users, the Aperture team is going to have to add a much stronger visual indication that "Primary Only" is active.  Marching ants, anyone?  Or a pink selection marquee?
    At least in the Viewer when multiple Images are selected the thin white selection marquee is dropped when Primary Only is active.  There is no such change in the Browser.

  • Remove text field from Array via for loop

    Hi,
    i have a problem to remove text fields added via for loop.
    That im doing is, via for loop im dynamically creating menu with 10 buttons.
    Each button contain, dynamically created, background (shape) and text field.
    And everything is fine.
    But when im try to remove text fields then i got this error:
    - Im using button to remove text fields - lang_btn.addEventListener(MouseEvent.CLICK, clickHandler);
    ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
              at flash.display::DisplayObjectContainer/removeChild()
              at Loading_Img_fla::MainTimeline/xmlLoaded()
              at flash.events::EventDispatcher/dispatchEventFunction()
              at flash.events::EventDispatcher/dispatchEvent()
              at flash.net::URLLoader/onComplete()
    In the script bellow marked with red is what should remove text fields from an Array, instead giving me error.
    Here is my script
    // Create for loop
    for (var i:int = 0; i < 10; i++)
              for each (xml in listItems)
                        if (i == xml.attribute("Id"))
                                  // Add MovieClip to stage to hold the data
                                  addChild(lmHolder);
                                  lmHolder.x = 0;
                                  lmHolder.y = 0;
                                  // Create new MovieClip to hold buttons
                                  lmButtonsMCArray[i] = new MovieClip();
                                  lmButtonsMCArray[i].buttonMode = true;
                                  lmButtonsMCArray[i].mouseChildren = false;
                                  lmButtonsMCArray[i].x = 20;
                                  lmButtonsMCArray[i].y = 20 + btCount * buttonSpace;
                                  // Add each button MovieClip to lmHolder MovieClip
                                  lmHolder.addChild(lmButtonsMCArray[i]);
                                  // Create Background to buttons
                                  lmButtonsArray[i] = new Shape();
                                  lmButtonsArray[i].graphics.beginFill(lmBgColor0, 1);
                                  lmButtonsArray[i].graphics.drawRect(0, 0, 230, 85);
                                  lmButtonsArray[i].x = 0;
                                  lmButtonsArray[i].y = 0;
                                  // <<-- Add Background shape to the buttons MovieClips
                                  lmButtonsMCArray[i].addChild(lmButtonsArray[i]);
                                  // Create a new array to preserve data from XML List
                                  lmNameArrayEG = new Array();
                                  lmNameArrayUS = new Array();
                                  // Create local variable to hold
                                  var lmTxtFieldContentUS:String;
                                  var lmTxtFieldContentEG:String;
                                  var lmTxtContent:String;
                                  // If clicked button is EG then make array with Arabic text
                                  // If clicked button is US then make array with English text
                                  if (footer.lang_btn.langState == "EG")
                                            for each (var leftMenuName:XML in egLanguageList)
                                                      lmNameArrayEG.push(leftMenuName);
                                            lmTxtFieldContentEG = lmNameArrayEG[i];
                                            lmTxtContent = lmTxtFieldContentEG;
                                  else
                                            for each (var leftMenuNameUS:XML in usLanguageList)
                                                      lmNameArrayUS.push(leftMenuNameUS);
                                            lmTxtFieldContentUS = lmNameArrayUS[i];
                                            lmTxtContent = lmTxtFieldContentUS;
                                  // Setup new text field each time script is executed
                                  lmTxtFieldsArray[i] = new TextField();
                                  lmTxtFieldsArray[i].width = 110;
                                  lmTxtFieldsArray[i].border = false;
                                  lmTxtFieldsArray[i].wordWrap = true;
                                  lmTxtFieldsArray[i].multiline = true;
                                  lmTxtFieldsArray[i].selectable = false;
                                  lmTxtFieldsArray[i].embedFonts = true;
                                  lmTxtFieldsArray[i].antiAliasType = AntiAliasType.ADVANCED;
                                  lmTxtFieldsArray[i].autoSize = TextFieldAutoSize.CENTER;
                                  lmTxtFieldsArray[i].text = lmTxtContent.toUpperCase();
                                  lmTxtFieldsArray[i].x = 10;
                                  lmTxtFieldsArray[i].name = "lmTxtFieldName" + i;
                                  // <<-- Add Text fields to the Movie Clip
                                  lmButtonsMCArray[i].addChild(lmTxtFieldsArray[i]);
                                  // If clicked button is EG then set Arabic text format, and make array with Arabic text fields
                                  // If clicked button is US then set English text format, and make array with Egnlish text fields
                                  if (footer.lang_btn.langState == "EG")
                                            lmTxtFieldsArray[i].setTextFormat(txtFormat_lm_eg);
                                            // Make array from text fields;
                                            pushEgTFintoArray.push(lmTxtFieldsArray[i]);
                                  else
                                            lmTxtFieldsArray[i].setTextFormat(txtFormat_lm_us);
                                            // Make array from text fields;
                                            pushUsTFintoArray.push(lmTxtFieldsArray[i]);
                                  // If clicked button is EG then loop thrue the for loop and remove English text fields from array
                                  // If clicked button is EG then loop thrue the for loop and remove Arabic text fields from array
                                  if (footer.lang_btn.langState == "EG")
                                            for (var rNr_us:Number = 0; rNr_us < pushUsTFintoArray.length; rNr_us++)
                                                      //remove the text field array from the display
                                       removeChild(pushUsTFintoArray[rNr_us]);
                                            //clear the array
                                            pushUsTFintoArray = [];
                                  else
                                            for (var rNr_eg:Number = 0; rNr_eg < pushEgTFintoArray.length; rNr_eg++)
                                                      //remove the text field array from the display
                                       removeChild(pushEgTFintoArray[rNr_eg]);
                                            //clear the array
                                            pushEgTFintoArray = [];
              btCount++;

    it looks like those tf's are children of  lmButtonsMCArray[i], not the current scope.  use:
    if (footer.lang_btn.langState == "EG")
                                            for (var rNr_us:Number = 0; rNr_us < pushUsTFintoArray.length; rNr_us++)
                                                      //remove the text field array from the display
                                        lmButtonsMCArray[rNr_us].removeChild(pushUsTFintoArray[rNr_us]);
                                            //clear the array
                                            pushUsTFintoArray = [];
                                  else
                                            for (var rNr_eg:Number = 0; rNr_eg < pushEgTFintoArray.length; rNr_eg++)
                                                      //remove the text field array from the display
                                        lmButtonsMCArray[rNr_eg].removeChild(pushEgTFintoArray[rNr_eg]);
                                            //clear the array
                                            pushEgTFintoArray = [];

  • How can I remove multiple hyperlinks from a slab of text?

    Hi everyone,
    I copy a lot of text from websites into Pages documents, and I'm looking for a way to remove multiple hyperlinks from a slab of text all at once without having to remove each hyperlink individually? This would save me a lot of time!
    Not sure if Pages actually has this feature - if not then it would be a good feature request. It would be similar to MS Word's function to clear a slab of text of all formatting (including hyperlinks).
    Any tips would be much appreciated!
    Thanks,
    -Chris

    Select all the text concerned. Then:
    This will stop them being live links but they will probably be blue and underlined. Click the underline button twice, and use the colour selector to turn them black.

  • Remove adjustment from multiple images?

    I have multiple images where I used Sharpen instead of Edge Sharpen. I know I can Lift & Stamp the Edge Sharpen adjustment to multiple images but I can't seem to find a way to remove the Sharpen adjustment from all of them first. Is there a way to accomplish this? Thanks

    I can add the other keyword using your techniqe, but how do I get rid of the wrong keyword without interfering with the other keywords I have already set for the images?
    Keywords are metadata, not adjustments.
    If you want to add or remove keywords to multiple images, without interfering with the keywords that are already set, I'd suggest to configurekeyword sets and to use the keyword controls:
    For example, after designing a keyword set"Himmel" (sky) I can add or remove one of the keywords for all selected images  by simply pressing a button in the keywords panel or using a key combination: for example ⌥6  to add the keyword "Halo" to all images, ⇧⌥6 to remove it from all currently selected images.
    But the question is, how to remove one adjustment from multiple images, and that seems to be behaving buggy in Aperture 3.4.1, at least on my system: If I try to add an adjustment to (or remove from)  multiple images, only the primary selection will be modified - and yes "Primary only is disabled ).
    For example: Trying to add "Sepia Tone" to four images: I see the same on two MBPs and on my iMac with Aperture 3.4.1.
    Regards
    Léonie

  • Removes duplicates from a sorted array without having to create a new array

    Funcation removes duplicates from a sorted array without having to create a new array

    Funcation removes duplicates from a sorted array
    without having to create a new arrayIs a 'funcation' like a vacation but more fun or
    something?LMFAO. You just jumped with both feet on one of my biggest peeves. I've been outed!
    Actual words/phrases I've seen used which I hate with every fiber of my being:
    "Mrs. Freshly's"
    "McFlurry"
    "Freshissimo"
    "Spee-dee"
    "Moons Over My Hammy"
    One of my favorite SNL skits had Will Ferrell leading a panel of movie reviewers (they're the worst for this kind of junk). Each one had some cheesy pun to describe their respective movie. Ferrell topped the show off with his endorsement of "Fantasia 2000 is Fantasgreat!"
    LOL.
    "Come to Slippy Village - it's a FUNCATION!"
    &#167; (runs off, laughing maniacally, head explodes)

  • How can I remove multiple duplicate photos from Photoshop Elements 6 catalogue?

    How can I remove multiple duplicate photos from Elements 6 catalogue?

    Newer versions have similarity recognition software but in PSE6 you have to do it manually.

  • Remove keywords from multiple pictures -  how to??

    REMOVING keywords from multiple images doesn't work here on Aperture 2.1.1. I select multiple pictures, remove a common keyword from the list in the Metadata inspector and... only the keyword from the picture which I selected last is being removed. All other pictures still have the keyword attached. Edit > Primary Only is not 'turned on'.
    What did I miss?

    Go to 'Window' > 'Show Keyword Controls'.
    In the text box, write the keyword that need to be removed from all selected images and press SHIFT + ENTER.
    If you use the Keyword Button Sets, you can also click on the keyword to be removed while holding down the SHIFT- key.
    Regards
    Paul K

Maybe you are looking for

  • Browsers won't open some php testing server files

    Running DW 8, OS 10.4.10, Apache virtual testing server with php local site. I've Firefox and Safari as primary and secondary browsers. When working on a page, if I select 'preview in primary browser', Firefox opens the page with my virtual url...no

  • Compressor doesn't convert the entire Blu-Ray file.

    I have FCP 7. Tell me if I've done something wrong here. 1. I exported as a quicktime file a wedding video that is about 3 hours long. 2. The file is all their from beginning to end. I then drop it into compressor and set it up to export the 120 gig

  • Index Corruption in database

    I am getting the below error when I run utlrp in my database. Please assist: ERROR at line 1: ORA-08102: index key not found, obj# 423571, file 6, block 113416 (2) ORA-06512: at "SYS.UTL_RECOMP", line 760 ORA-06512: at line 4 I have run dbverify on F

  • Printing Issue after Migrating to Windows 7

    I just migrated to Windows 7 and have received the below issue in only SAP I have granted all users access in the securities tab. (12:06:17 PM) Number of processors: 4 (12:06:17 PM) Icon DLL loaded. (12:06:17 PM) (12:06:17 PM) Network Communication v

  • Inter-portlet (JSR286) in liferay portal

    i had created two portlets using ADF and i can consume them in WebCenter Portal apps. Nothing has to do in the portal side as webcenter auto-wire the portlets. The question is how i can consume the portlets in liferay? is there any step required in t