The closest point of all in a table

Hello

I have two table 2D elements. Array1 and array2.

I take a value from the array Array2 and calculate its distance from all elements of array Array1. I need to get the item that is the short of it. How is this posible?

I did a VI. After that calculation of the distance how is it possible to check the short and how to keep that close to the value in a table?

Please take a look

Thank you

Although I don't understand quite what kind of output you want, here's a possible solution that can probably point you in the right direction. Good luck!

I assume that you want the value of the item to the nearest table and I guess by the distance you are talking about the 2D distance between two points in the complex plane. Other interpretations would be to get the closest value array indices, for example.

Tags: NI Software

Similar Questions

  • Help: SQL to select the closest points within groups of documents grouped by hour

    Hello
    I need help to find a SQL for an effective solution to the following problem:
    -J' have 20 buses circling on a bus line and their locations are reported every 10 seconds and recorded in a table space 'bus_location' with 'bus_loc' as the SDO_GEOMETRY type.
    -Location of bus each record there is a column msg_datetime with the time when the position has been saved.
    -Bus circle the the bus route 8 to 12 times, from A to B, then b back to A, then new loop from A to B and so on.
    -J' have 3 points of synchronization in the spatial table "timing_point" with "tp_loc" as the SDO_GEOMETRY type.
    -A bus will pass each timing point 8 - 12 times in one direction and 8 - 12 times the other way, while making the loops on the road to the bus.

    My task is: for each timing point, every bus, (A - B or B - bis), find nearest bus for each direction of travel place to this timing point.

    Example:
    Bus... * TimingPoint *... * time *... * Distance *.
    ...........................................*between*
    ...........................................*bus and TP*
    12......A................ 14:01, 250 m
    12......A................ 14:01:10... 150 m
    12......A................ 14:01:20... 12 m < == it is closest to the TP for this pass
    12......A................ 14:01:30, 48 m
    12......A................ 14:01:40... 100 m
    12......A................ 14:01:50... 248 m
    12......A................ 14:29:40, 122 m
    12......A................ 14:29:50, 72 m
    12......A................ 14:30... 9 m < == it is closest to the TP for this pass
    12......A................ 14:30:10... 10 m
    12......A................ 14:30:20... 12 m

    I tried to use SDO_NN, and I just can't close bus locations, but how do I find the location of bus closest to each passage? Or how to identify a location of bus groups who are together in 2-3 minutes and find the record closest to each of these groups of locations?
    I thank very you much for any help.

    Milan

    Published by: mburazor on February 9, 2012 14:41

    Milan,

    Yes, the problem is one of the non-space analytical. Here's another GB, which should be independent of the year/month/date/hour/minute
    as it does all its math based on an absolute number of minutes since 1970. I turn to 5 minutes but you could round/trunc at all
    interval (5 minutes, 10 minutes, 15 minutes, etc.)

    Note that I have created additional folders in the same table I built. (Tip: good idea to provide an example of dataset on the forum when)
    ask tough questions of SQL like this).

    drop table buslocns;
    
    create table buslocns(
    busno number,
    timingpt varchar2(1),
    pttime   timestamp,
    distance number)
    ;
    insert into buslocns values (12,'A',to_timestamp('2012/02/10 14:01:00','YYYY/MM/DD HH24:MI:SS'),250);
    insert into buslocns values (12,'A',to_timestamp('2012/02/10 14:01:10','YYYY/MM/DD HH24:MI:SS'),150);
    insert into buslocns values (12,'A',to_timestamp('2012/02/10 14:01:20','YYYY/MM/DD HH24:MI:SS'),12);
    insert into buslocns values (12,'A',to_timestamp('2012/02/10 14:01:30','YYYY/MM/DD HH24:MI:SS'),48);
    insert into buslocns values (12,'A',to_timestamp('2012/02/10 14:01:40','YYYY/MM/DD HH24:MI:SS'),100);
    insert into buslocns values (12,'A',to_timestamp('2012/02/10 14:01:50','YYYY/MM/DD HH24:MI:SS'),248);
    insert into buslocns values (12,'A',to_timestamp('2012/02/10 14:29:40','YYYY/MM/DD HH24:MI:SS'),122);
    insert into buslocns values (12,'A',to_timestamp('2012/02/10 14:29:50','YYYY/MM/DD HH24:MI:SS'),72);
    insert into buslocns values (12,'A',to_timestamp('2012/02/10 14:30:00','YYYY/MM/DD HH24:MI:SS'),9);
    insert into buslocns values (12,'A',to_timestamp('2012/02/10 14:30:10','YYYY/MM/DD HH24:MI:SS'),10);
    insert into buslocns values (12,'A',to_timestamp('2012/02/10 14:30:20','YYYY/MM/DD HH24:MI:SS'),12);
    
    insert into buslocns values (12,'A',to_timestamp('2012/02/10 14:59:40','YYYY/MM/DD HH24:MI:SS'),53);
    insert into buslocns values (12,'A',to_timestamp('2012/02/10 14:59:50','YYYY/MM/DD HH24:MI:SS'),28);
    insert into buslocns values (12,'A',to_timestamp('2012/02/10 15:00:00','YYYY/MM/DD HH24:MI:SS'),12);
    insert into buslocns values (12,'A',to_timestamp('2012/02/10 15:00:10','YYYY/MM/DD HH24:MI:SS'),73);
    insert into buslocns values (12,'A',to_timestamp('2012/02/10 14:44:40','YYYY/MM/DD HH24:MI:SS'),53);
    insert into buslocns values (12,'A',to_timestamp('2012/02/10 14:44:50','YYYY/MM/DD HH24:MI:SS'),28);
    insert into buslocns values (12,'A',to_timestamp('2012/02/10 15:45:00','YYYY/MM/DD HH24:MI:SS'),12);
    insert into buslocns values (12,'A',to_timestamp('2012/02/10 15:45:10','YYYY/MM/DD HH24:MI:SS'),73);
    
    commit;
    with tensOfMinutes as (
    select row_number() over (order by busno,timingpt, pttime) as rid,
           busno,
           timingpt,
           pttime,
           round(((cast(pttime as date) - cast('01-JAN-1970' as date)) * 1440) / 5) * 5 as mins,
           distance
      from BUSLOCNS
    )
    select busno,timingpt,to_char(to_date('01-JAN-1970','DD-MON-YYYY') + ( mins / 1440 ),'DD-MON-YYYY HH24:MI:SS') as pttime,minDist
      from (select busno,timingpt,mins,min(distance) as minDist
              from tensOfMinutes a
             group by a.busno, a.timingpt, a.mins
             order by 1, 2, 3 ) ;
    -- Result
    --
    BUSNO                  TIMINGPT PTTIME               MINDIST
    ---------------------- -------- -------------------- ----------------------
    12                     A        10-FEB-2012 14:00:00 12
    12                     A        10-FEB-2012 14:30:00 9
    12                     A        10-FEB-2012 14:45:00 28
    12                     A        10-FEB-2012 15:00:00 12
    12                     A        10-FEB-2012 15:45:00 12
    

    concerning
    Simon

  • How to assign values to the application points to leave on a table

    Hello

    I have a FORM on a table with two or three elements. How to assign values to the elements of the application with the values in the elements of form, every time the value of the element is entry, change or page is sent?

    I created a dynamic action to the region level with Event - change to run the suite of PL/SQL, I tried with 3 different ways in PL/SQL, as shown below, but it didn't work.

    BEGIN

    : APP_FY: =: P1_FY;

    END;

    BEGIN

    APEX_UTIL. SET_SESSION_STATE ('APP_FY', v ('P1_FY'));

    : APP_FY: =: P1_FY;

    END;

    BEGIN

    APEX_UTIL. SET_SESSION_STATE ('APP_FY', v: P1_FY);

    END;

    Then I created an action dynamic at the ITEM level with change event to run the suite of PL/SQL and tried with PL/SQL, as shown below, but it didn't work.

    I need to assign values to the elements of the request form as these elements of the application will be used in many other pages in the application. How to I get there?

    Thank you.

    If a dynamic action of PL/SQL execution, you must send your list of page elements in the parameter "Elements of Page to submit.

    See the section 'run pl/sql' for this post.

    If the page is submitted, the elements of the page will be automatically set to session state, and you can have a page process make the code you have.

  • apply the character style to all get a table row?

    Hi chaps (and chapettes)

    I have a table - on some lines, I need to change the style of character to "Bold".

    How should we do about it in Javascript?

    see you soon

    Buzz

    Have you thought about this?

    myRow.cells.everyItem () .texts [0] .appliedCharacterStyle = myChstyle;

    Does it work? The difference between this one and your function is that you avoid using the style of the empty cells c., which is not possible with the one-liner above.

    Peter

  • Align with the graphic point nearest

    I have a chart xy with several points. The graph is controlled by a mouse press event, when the user clicks on the chart, he draws a red circle at the point of click. My question is how I would get this to align with the closest point?


  • Setup removes the junction point NTFS redirect the folder system "\Windows\Installer" on another disk.

    On a computer running Windows XP Professional SP3, I redirected the "\Windows\Installer" system folder, with a junction to a record point in a tree of directories to a different drive.  The operation was conducted and verified using "junction v1.06 - creator of junction point analysis viewer and Windows' published in 2010 by Mark Russinovich. I moved all the files and subdirectories contained in the original "\Windows\Installer' in the target directory (the these files had been previously copied to a temporary directory and after the move, I checked that they were visible in the folder '\Windows\Installer' open the symbolic link with the Explorer).
    Then I launched a system patch, and I discovered that the installation of the update of the software deleted program point junction that I created, deleted all the cache contained in the directory with the name of substitute target different files and recreated the "\Windows\Installer" folder in the original disc.
    I tested this behaviour a couple of times, installing various software and updates, so I assume that it does not depend on the software that is installed but the installation program itself, which cannot handle a point of junction of the folder "install".
    No warning is given before deleting the junction point and all of its contents.  With a similar procedure, I made two points of junction for '\Windows\Downloaded facilities' and '\Windows\Microsoft.NET' and they have exploited properly.
    Out of understanding points do not work on startup, so it is impossible to redirect for example. :

    • \Windows
    • \Windows\System32
    • \Windows\Config

    "\Windows\Installer" isn't one of those cases, and it is not used at startup.

    Is it possible to use a junction point to redirect the \Windows\Installer on another disk/partition folder, or Setup will always delete all the files that have been targeted in the naming of replacement?

    Hello

    Your question would be better suited for the TechNet forums.

    I suggest you to ask your question to the TechNet forum for better support.

    http://social.technet.Microsoft.com/forums/en-us/itproxpsp/threads

  • How to return a query all the elements for an LOV if I select the "white point" (in this LOV)

    Hello. In my application, I have a classic report where, in a region, I built a toolbar with three Popup LOVs which interact with the report. Each LOV displays different items and returns the value according to the selected item.

    For example:

    Popup LOV 1 named P33_DEPARTMENTS has the following components: production, development, projecting, ecc.

    Popup LOV 2 named P33_LOCATIONS was the following: Europe, America, Asia, Africa, ecc.


    Popup LOV 3 named P33_DEVICES has the following: printer, keyboard, mouse, monitor, ecc.


    If I query the table to return the lines according to the selected in these LOVs I have something like this:


    SELECT * FROM < table > WHERE the dep =: P33_DEPARTMENTS AND loc =: P33_LOCATIONS AND dev =: P33_DEVICES


    Now I want that if the user selects all values (LOVs one white point) (or all), then the query must return all values for that LOV.

    For example, if for the named LOV P33_DEPARTMENTS 'white' value is selected, then the query must return to the table lines this cointain values "production ' OR 'developing' OR 'project', ecc for the columns named"dep".

    This means that must be the operator AND between LOVs but the operator or inside the LOV even, if the item is selected.


    How is it possible? Thank you

    SELECT *
    FROM T
    WHERE dep = nvl( :P33_DEPARTMENTS, dep)
      and loc = nvl( :P33_LOCATIONS, loc)
      and dev = nvl( :P33_DEVICES, loc)
    

    You just need to ensure that, when no value is selected, the LOV will return a NULL value.

    MK

  • "All the data Points" option missing on totals

    In a specific workbook (Discoverer Desktop 10.1.2.2), when I go to edit or create a total for one of the worksheets Table, 'All the data Points' option is not there. I can always create sums, counts, etc. on the individual columns. I forget something obvious? There are some sets of circumstances where "All the data Points" would not be an option?

    Hello

    You will have only the option "All the data Points" when you create a new total if there is a data point in the report. Unlike a crosstab report where you can drag an item in the crosstab table to a data point, in the report of the table there is no way to tell Scout that a calculation is a data point.

    Items (including the calculated items) in a folder can be changed to be a data point by changing the property to default to "Data point" position using the administrator of the Disco. If you add a data point in the report, then 'All the data Points' option will be available.

    Also you can cheat discoverer by using a calculation as a data point using an aggregate function for example sum (case where student_grade like 'A%' then ends 1 0 otherwise), but discoverer will then use a group by in the query, and this can give you a different result.

    Rod West

  • How do you find the average value of all the data between two points on a single channel

    I'm tring to calculate the average value of all data points in a single field between two distinct points

    I rasthaus an illustration.

    Hi smoothdurban,

    I thought you wanted to specify the area of interest with the sliders of the band.  If you rather automatically define the area of interest based on thresholds, etc., we cannot see the interactive nature of the example I sent.

    What are the criteria used to determine the start and end of the region of interest lines?

    I would be able to type this out for you if you sent a representative data set ([email protected])

    Brad Turpin

    Tiara Product Support Engineer

    National Instruments

  • You use the zoom of the band to select all the data points in the Strip

    I feel stupid this morning. I am a new user with 2011, but have not figured out how to copy a portion of the data. I can use the 2D axis system view to view my data. Can I use zoom band to get the part I need, but for the life of me I can't seem to copy the part. I put at the beginning and end and other flags, but the best I have is the starting point, one no point value and the end point. I don't get all the points between the flags. Am I supposed to mark somehow all the points in the zoom view? I did a search, but may not know what I am doing wrong.

    Robert

    WOW! If simple, yet I kept missing it. There is a difference between "Band Zoom" and "band of cursor. Thank you very much! Feeling little sheepish here now .

    Robert

  • Find the table if element have the same element in all indexes

    Hello

    I need to check if a table have the same element in all its indexes. (Example: an array of size 4, should have index 0... 3 1 and during the next iteration index whether no. 2 overall indexes...) How can I check if all indexes have same number)

    Attached to the VI I did.

    Anyone can offer better than this.

    get the first element, compare it with the hole dashboard, AND all items

  • At all indexes on tables of the same value in the structure of the event

    Hello

    I have a panel with the four bays and I use a structure of the event.

    Now, I want that change of the index of array_1 also affects the index of 3 other tables at the same index.

    But there is only a property "value Exchange" and no property 'index-change' in the properties of the table.

    So I read the 'index' property and write in the other table.

    But: It seems as if I have to do so within the period of waiting-section of the structure of the event.

    Is there another way to do this?

    Thanks for help

    You can use the mouse event on each table to detec the event (of course, that will attract not only a change of index, but I don't think you care too) and then use the 'values of the indices' property on all the table to set.

    See annex VI (LV2012), hope this helps

  • How can I set the time axis on my waveform table to show run time that is to say whenever I start the program I should have 0 as the starting point

    How can I set the time axis on my waveform table to show run time that is to say whenever I start the program I should have 0 as the starting point. I've been messing around with the without success. I'm under Labview 2012.

    Thank you!

    Townes wrote:

    I can't understand what you mean. I have no formal training with labview. It took me a long time to write the simple program that I joined. Any guidance would be greatly appreciated!

    Its pretty normal for a beginner to take the time to write code. Right-click the map of waveform > Create > property node > historical data, you will get a property node, keep this at the beginning of the code and create a constant. You can also go to the VI properties and > run and select "clear indicators when it is called.

    I recommend you to go through the basic materials of LabVIEW which will give you an understanding on the basics of bases/components of LabVIEW.

  • How to find the index of the closest value in table

    Hello

    I have a double-table A and a double value B.

    I'm looking for on what number in the table A is the closest number to number B?

    Thanks for help

    If the array is sorted, built-in 'Threshold 1 D Array' might work for you.

  • lost all the restore points after the reinstatement of windows

    Original title: have just re-recorded windows software, now Ifind I lost all the restore points. How can I get the old one back?

    Windows has been registered online. Checked restore points after recording and found that the only listed restore point was created when the software has been registered. How can I find the previous restore points?

    If you reformatted and reinstalled windows, you will lose any restore points. Theyre gone

Maybe you are looking for