Convert array components to re/im values?

I have 2Darray and want to convert its componants to re/im values
want to be
26+49i
81+93i
and want that for any values not specific one (cant input values by myself) want sol. for general case 
Solved!
Go to Solution.

GerdW wrote:
why do you let us answer that question in two places?
Why do you create double posts?
Twice the exposure means twice the chance of getting an answer?  In reality, it just annoys people on the board and you then have half the chance of getting an answer.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines

Similar Messages

  • Index array is not getting new values from DAQ

    I am measuring force values with my DAQ card and these values are always changing.  However, in my programming something is not working right with the way I have things set up.  After my DAQ I have a "Convert to Dynamic Data" and after that I have an "Index Array".  When the program is executing and I turn on the highlight option I do not get changing force values after the "Convert to Dynamic Data" and therefore no changing force values enter my "Index Array".  Whaterever the first value is that gets passed to the "Convert to Dynamic Data" is the only value that I get for the remainder of the program.  I tried plugging in an indicator between the DAQ and the "Convert to Dynamic Data" and it did show varying values.  Please help with my program.  I have tried messing with the properties of the "Convert to Dynamic Data" and nothing has worked.  I am stuck and cannot see how to fix this problem.  I have attached my program as it is currently put together.
    Thank You In Advance,
    Gabe.
    Attachments:
    Actuator_Gabe_Oct27_Flat_Sequence_XY_+Measurement_File.vi ‏131 KB

    Please know that the best option is to review the concepts discussed to further understand programming in LabVIEW.  Perhaps you could take a look through ni.com/gettingstarted and ni.com/lv101 to have a look at some of the online help materials.  I have included a VI snippet of the while loop containing the changes.  Further, the code you attached contains a lot of customer controls and VIs, which are not common to all LabVIEW users.  It is a best practice to only attach the code of value to the question/post, and to have the most simplified version of the problem.
    Best,
    Adam
    Academic Product Manager
    National Intruments

  • Having trouble converting array to spreadsheet string, storing the file and coverting back to array with complex numbers

    I am working with a network analyzer. I have arrays made of 5 columns the first consisting of an integer and the next four consisting of complex numbers. I am converting the array into a spreadsheet string and then saving the file using the write characters to a file VI. That seems to work well as when I open the file in Excel all the data is there. However when I try to reverse the process, open file and convert back to array, I loose some of the data. Specifically the imaginary parts of my complex numbers are all going to zero. I have narrowed down the problem to be in the conversion from spreadsheet string to array and vice versa. I
    think the problem may be with the 'format' input to the VI. I do not have an adequate resource for this so I am not sure what to put in to accomplish my task. Any takers?

    Hi Biz
    I don't think there is a direct way of converting a complex number to a
    string, so when you convert the array to a spreadsheet string, the
    numbers would be converted to real data.
    However, you could try separating the real and imaginary parts using the
    "Numeric: Complex to Re/Im" function, and then store these - either in
    separate files or in adjacent columns/rows in the same file. Then, when
    you read in the data again, use the "Numeric: Re/Im to Complex" function
    to put the two "halves" together.
    If you actually want Excel to interpret the numbers as imaginary, then
    you'll probably want to create a string for each complex number of the
    form "Re + Im*i" (after separating the Re and Im parts), by using
    "String:Format into String" with 2 numeric inputs and the format string
    "%f+%fi".
    Reading the data back into Labview then would require splitting the
    string into the 2 pieces by using "Stringcan from String" with 2
    numeric outputs (smae precision as original numbers specified by the 2
    Default Value inputs) and the same format string "%f+%fi", and then using
    the above-mentioned "Numeric: Re/Im to Complex" function. It worked for
    me, so if you can't follow what I am describing, send me an email and I
    can email you what I did (LV 5.1.1).
    Paul
    Biz wrote:
    > Having trouble converting array to spreadsheet string, storing the
    > file and coverting back to array with complex numbers
    >
    > I am working with a network analyzer. I have arrays made of 5 columns
    > the first consisting of an integer and the next four consisting of
    > complex numbers. I am converting the array into a spreadsheet string
    > and then saving the file using the write characters to a file VI. That
    > seems to work well as when I open the file in Excel all the data is
    > there. However when I try to reverse the process, open file and
    > convert back to array, I loose some of the data. Specifically the
    > imaginary parts of my complex numbers are all going to zero. I have
    > narrowed down the problem to be in the conversion from spreadsheet
    > string to array and vice versa. I think the problem may be with the
    > 'format' input to the VI. I do not have an adequate resource for this
    > so I am not sure what to put in to accomplish my task. Any takers?
    Research Assistant
    School of Physiotherapy, Curtin University of Technology
    Selby Street, Shenton Park, Western Australia, Australia. 6008
    email: [email protected]
    Tel. +61 8 9266 4657 Fax. +61 8 9266 3699
    "Everyone who calls on the name of the Lord will be saved." Romans 10:12
    "For all have sinned and fall short of the glory of God, and are
    justified freely by his grace through the redemption that came by Christ
    Jesus." Romans 3:23-4

  • Converting Array Objects into ArrayCollections

    Hi,
    I am facing problem with converting Array Objects into ArrayCollections. How can i convert Array Objects into ArrayCollections. If any one knows how can we do that Pl reply.
    Thanks in advance to all
    Regards
    subbareddy.p

    Hi Bhasker,
    thanks for u r reply. Here i attached screen shot of my server "data.result".
    My proxy varaible contains
    My object varaible "obj" contains
    After parsing the result my arraycollection contains, (i mean after converting Object to Array to ArrayCollection) the below information. For information Pl find the attached arraycollection.png image. In the attached image my arraycollection name is "users".
    Here i pasted the code that i used  to convert  "ObjectProxy" to "ArrayCollection"
    var proxy:ObjectProxy = ObjectProxy(data.result);
                var obj:Object = proxy.object_proxy::object;
                var arrycoll:Array = ArrayUtil.toArray(obj); 
                model.users = new ArrayCollection(arrycoll);
    Regards
    sss

  • How to convert signed ascii hex to float value

    Hi,
    I have a requirement to convert IEEE ascii hex to float value.
    Following code is working for +ve float value but it didn't work for -ve.
    public static float hexToFloat(String str){
              float floatVal= 0.0f;
              int decimalValue =Integer.parseInt(str,16);
              floatVal=Float.intBitsToFloat(decimalValue );
              return floatVal;
    for example "BE4CE1E6" should return -0.20 . (i verified in http://babbage.cs.qc.edu/IEEE-754/32bit.html )
    For the above string I am getting number format exception.
    pls help me.

    The problem is the parseInt method. It can only process numbers up to 2147483647 or 7FFFFFFF. Because that method expects a signed number.
    The solution is to use Long.parseLong() instead.
    public static float hexToFloat(String str){
    float floatVal= 0.0f;
    int decimalValue =(int)Long.parseLong(str,16);
    floatVal=Float.intBitsToFloat(decimalValue );
    return floatVal;
    }

  • Converting unsigned to java signed byte value

    Hey ,
    i need to use a raw address in a client i am writing but, of course, the address contains a byte outside of the java signed byte range. if any one could tell me what an unsigned byte of 224 in signed java is i would be very grateful, if you could also show how you did this it would be appreciated. thank you =)

    Re: Converting unsigned to java signed byte value
    i need to use a raw address in a client i am writing
    but, of course, the address contains a byte outside
    of the java signed byte range.
    if any one could tell
    me what an unsigned byte of 224 is in signed java
    I would be very grateful, if you could also show how
    you did this it would be appreciated. thank you =)You misunderstand signed/unsigned.
    A byte has 8 bits. It can represent 256 different values.
    Viewed as an unsigned scalar the range is [0;255].
    Viewed as a signed two's-complement scalar the range is [-128;127].
    Values [0;127] are obviously the same byte values in the two views.
    What the other half of the possible byte values represent depends on what view you adopt.
    You don't need to convert anything.
    public final class Byte224 {
        static byte[] byteArray = {
            (byte)224, (byte)'\n'
        public static final void main(final String[] arg) {
            System.out.println("0x"+Integer.toHexString(byteArray[0]&0xff));
            System.out.println(Integer.toString(byteArray[0]&0xff));
    }

  • Converting array of Double Precision values to U16 for MODBUS

    Hello,
    I am trying to send over pressure and temperature information via the Input Register array in MODBUS TCP.  My question is, how to I properly send over an array of double precision values without loosing my data?
    For example, my array of data looks like:
    12.0001
    32.001
    0.00051234
    0.0014838
    1.02
    12.0232
    31.920
    Thanks so much.

    Thank you Ravens Fan for replying.
    I missed one extra point of data.  Below is what I'd like to send:
    12.0001
    32.001
    0.00051234
    0.0014838
    1.02
    12.0232
    31.920
    2046
    The array above is an array of double precision values.  I will convert that array to an array of single precision floating data to reduce data size.
    Since I have eight pieces of single precision floating point data now, I will need to write to 16 registers correct?  What is the best method to split up each piece of data into two consecutive registers?
    Attached is a Slave Send Data.VI that I want to send this data through.  The end goal is to have a Master PC (not using labview, but a MODBUS utility) to read my MODBUS TCP message from the "Slave Send Data.vi" 
    Thanks
    Attachments:
    Slave Send Data.vi ‏15 KB

  • Convert array of clusters to cluster of arrays without for loop

    Hi!
    Here's a problem: I've got an array of clusters (array of messages). Each cluster consists of elements of different data types: double (time), cluster (parameters), char (station id), byte (message code). I know one cluster size and the array size. I need to draw a time graph. How can I convert the array of clusters to a cluster of arrays (array of time values, array of parameters clusters, arrays of chars and bytes).
    I post this question because in my real array of clusters each cluster consists of 162 elements and some of them are clusters themselves, so I realy dont want to wire "for" loops as was advised in other topics.
    Hope to get fresh ideas. Memory management? Type Cast? FlatternStrings and variants? Anything!
    Thank you. 

    Idea wrote:
    Hi, everybody! Glad you read the post! 
    There is the cluster in the attachment. The application I make is a TCP client. The cluster is a message. Actually I get a string, find edges ("DIAG" - begin, "GAID" - end) and then I use "unflattern to string" for making the cluster. I cann't make another structure of the message - I didn't make the server. My client has a buffer of recieved messages. I need to plot graphs of different cluster elements for all messages in my buffer (for example the Time 1 element). If I use the for loop it would be too slow. The idea was to convert all buffer to a 2D array of U8 and then use type cast to get the cluster of arrays. Then it would be easy to take ane cluster element and send it to graph.
    I didn't sucseed yet. 
    Idea. 
    What is your question about?
    A) convert the string you get from I don't know where to the giant cluster, the red part in your message, or
    B) making a graph out of some element from that giant cluster, who now is in an array, the blue part in your message.
    The code you showed us looks a solution for question A but no loop is needed for this. So why bother about a loop that would be too slow here?
    Also your code start from an array of U8, so where's the string?
    If you could provide a string that needs conversion, we could try another way ... ...
    Question B can easily be solved with a for loop and "unbundle by name". Don't know where you get the idea that a loop would be too slow
    Open G library has a lot of VI's to retrieve specific elements from clusters, maybe one of those could help solve the problem.

  • Converting Array of string to an array of integers

    I have a problem converting a array of string to array of int's
    This is my code...
    String[] forminfo = request.getParameterValues("forsendur");
          int[] forminfoInt = Integer.parseInt(forminfo); This is the error message:
    Incompatible type for method. Can't convert java.lang.String[] to java.lang.String.
                          int[] forminfoInt = Integer.parseInt(forminfo);
                                                               ^can anyone help me with this?

    ParesIn methos returns a int buto not a int[]. You must iterate along the String array and perform the methos for each element setting the return value into the element of the int array
    Ej:
    int[] intArray = new int[stringArray.length]
    for(int i = 0; i < stringArray.length; i++)
    intArray[i] = Integer.parseInt(stringArray);

  • Array of Ring to string value for creating a table

    I want to convert an array of ring to string and generate a table from it.
    But using property node for converting each ring is changing all the value of the table!
    each array represents different register!hence required to change  for different array! 
    i am hereby attaching a  Vi!
    Solved!
    Go to Solution.
    Attachments:
    Untitled 1.vi ‏1944 KB

    How about this simple solution? Array of a ring control to Array of string.
    /Y
    Message Edited by Yamaeda on 04-13-2010 08:36 AM
    LabVIEW 8.2 - 2014
    "Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
    G# - Free award winning reference based OOP for LV

  • How can I convert array of database variant to cluster?

    When I use the Database Connectivity Toolkit to read a recordset from a database, I just use a SQL query.  This returns an array of variant data.  I have always just indexed this array in a sequence structure that has the database variant conversion function in it and build a cluster from that.  There has got to be an easier way, but I can't find it.  Of course, my recordset has various data types in it.  Any ideas?

    Here is the  seed of an idea I had been nocking around.
    Compose an SQL query based on the cluster elements. I chose to use the caption of the cluster elements so that the unbundles have the names I want but the caption can be set to match the collumn names from the table. (If you really want to get fancy, update the captions of the cluster of the typedef before the application opens)
    Do the query and get your array of variants. They should be returned in the order of the query (which we composed based on the cluster order)
    Pass the array of variants into another foor loop that uses the Class ID to do the variant conversion.
    Come to think of it....
    Just wiring the variants to the geneic value refs of the cluster may be good enough.?????
    In theory if "cluster" is a type def, new fileds can be added to tthe typedef and it should get updated from the DB.
    Maybe turn this into a template?
    Your thoughts?
    Ben
    Message Edited by Ben on 01-03-2007 09:02 PM
    Message Edited by Ben on 01-03-2007 09:04 PM
    Message Edited by SarahM on 01-08-2007 12:24 PM
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction
    Attachments:
    Cluster.JPG ‏92 KB

  • How can I convert (or switch) the RGB percent values from the LR histogram into RGB values which are shown e. g. in PS/CameraRAW?

    In LR 5.5 (same in previous versions) the RGB values in the histogram are shown in percent (relativ) values. I prefere to see the absolute values, but I can`t find any way to switch. Maybe this option is intentional disabled, because LR works in 16-Bit mode this would result in values up to 2^16. But as i compared the relativ values from LR with the absolute values from PS i run into a conversion problem. The following example shows the differences:
    CameraRAW : RGB, 128,0,0
    Lightroom: RGB, 43,8%, 19,0%, 6,2%
    CameraRAW: RGB, 0,128,0
    Lightroom: RGB, 29,8%, 47,5%, 17,5%
    Mainly i have two questions:
    1. Is there any possibility to change the percent RGB values in LR to absolut values?
    2. How can i convert CameraRAW values to LR values (see above)?

    TThe reason that a design decision was made from the beginning of LR to show only the percentage values was that RGB values are dependent on the color space and the LR histogram and numerical readout are derived from the Develop module's display space which is a hybrid color space with ProPhoto RGB primaries and the sRGB TRC. Thus the numerical values in the display would be different from the exported RGB image (in an orthodox space) and it was feared that this would be misleading. When soft proofing was introduced, because it involved converting the display to an orthodox space, it became possible to use the 0-255 scale in that mode.

  • Decimal format time value to convert into time (hr:min:sec)value in a graph

    I need to develop a graph in WAD, in BW7. In the graph the value must be showed as HR:MIN:SEC, which I cannot get it right.
    The keyfigure value  carries the duration(hr:min:sec) in decimal format.  In the query, I use this keyfigure for calculation. To get the time broadcasted for a week range. I get the total duration (say 507835.000). Now I need to convert this value back to hr:min:sec. I use the below formulas to get the hr, min, sec.
    D = 507835
    Val1 = D/3600
    Val2 = Frac(val1)
    Val3 = Val2 * 60
    Val4 = frac(Val3) * 60
    Hr = Val1 – Val2
    Min =  Val3 – frac(Val3)
    Sec =  Val4
    In another formula in the query I add Hr + Min/100 + Sec/10000 to get hr.minsec format.
    When I do an average on count of weeks,  this doesn’t round off correctly.
    I tried to also use the Data function TIME() which when the time is > 24 hrs changes the value.
    Lets say if it is 39:00:00, it shows value as 15:00:00 instead of keeping the value 39:00:00.
    When I used this value in the graph it did not show the HR:MIN:SEC values in the value axis instead  it showed 0.0, 0.1,….1.0. Bcoz of this the graph is blank.
    Can anybody help me to resolve this problem.
    Thanks alot
    Anima

    I checked SU01 and didn't see anything there to customize...
    In my workstation, control panel / regional and languages settings / tab regional Options / customize; my time format is HH:mm:ss; the HH has to be in capital letter to display the time in 24 hour...
    but this is strange anyway... are you reporting with web frontend or excel?

  • Converting MXML Components to ActionScript Classes

    I'm in the process of converting most (if not all) of my MXML
    components to Action Script classes. I've found this is easy, and
    doesn't require a lot of extra code when extending a simple
    container or control. However, several of my MXML components have
    several nested containers and controls - i.e. a component that
    contains several Labels, a ComboBox, a TextInput, a Button, and a
    DataGrid, plus several other containers needed for layout. To code
    the layout of all these containers and controls using MXML, it uses
    about 16 lines of code. To code the layout in ActionScript, it
    takes about 50+ lines of code (see attached).
    I'm just wondering if there are any best practices for
    creating ActionScript classes that include several (or even A LOT
    OF) containers and controls. It's very easy to layout in MXML, and
    is more visibly pleasing to look at and understand, but I feel it
    is best practice to code components as ActionScript classes. I know
    I should be using MVC, but it's a little late to rewrite the entire
    application now.
    Any thoughts?

    I can't specifically speak to how to write layout code in
    ActionScript, but you can look at the generated code that Flex
    creates to get an idea of how Flex does it. When you compile an
    app, the Flex compiler takes your MXML input and converts it to
    ActionScript classes before compiling the entire set of classes
    into a SWF. Because of this, you can look at the interim
    ActionScript code.
    You do this by setting the keep-generated-actionscript
    compiler option to true and looking in the /generated directory.
    hth,
    matt horn
    flex docs

  • Convert array to fewer smaples per second

    Have large array with 9 channels of data per times stamp.
    Timestamp shows that there are about 100 samples per second.
    I need to generate array that only displays one average value per channel, per second.
    Struggling with "build array" and "indexing" to get proper array.
    Suggestions??
    Solved!
    Go to Solution.

    I might even attach the VI this time!! (V 8.6)
    Attachments:
    Array -channel data.vi ‏9 KB

Maybe you are looking for

  • HP Laserjet p2035n Can't set DHCP

    Hello I have a HP Laserjet p2035n connected via a switch to a LAN. The printer had a static IP address configured, and handled print jobs from connected PCs with no problem till yesterday. The printer stopped responding to print jobs sent accross the

  • New iPod TV out resolution

    Do the new iPods output video at the newly supported 640x480 resolution or do they output the scaled version of the video that they display on their own screens? Same question for the old 5G iPods with the updated firmware. Thanks.

  • Did iTunes damage my files?

    I've started to discover that some files in my iTunes library are damaged. In some songs you can hear sudden noises, crackling "white noise". I listen mostly to ALAC, so at the moment it's only ALAC files I've found to be damaged, if it also applies

  • TREX vs Enetrprise Search - Talent Management

    Hi, We are implementing Talent Management and would like to find out what do we require for the enabling search functionality. Do we require TREX or Enterprise search? We currently have TREX version 7.0 installed and not Enterprise search. What is th

  • Dbo login name problem

    Hello, After copying my R/3 system - detach from the source and attach to the destination i noticed that that the dbo user does'nt have a login name configured.I used the sql stored procedure to attach the copied database as described in note 151603