Replace formula MathScript node

For some reason, module Script of Math is only a license for my 32-bit LabVIEW 2014, but not for my 64-bit version that is installed on the same machine.

Therefore, I need to replace a routine MathScript with formula node. Here is the code:

j = 1

for i = 1:2: n-1

Odd (j) = a (i)

j = j + 1

end

j 1

for i = 2:2: n

(J) = a (i)

j = j + 1

end

The code simply takes in an array 'A' size ' n "and the outputs of the two tables, one of the odd indexes and one for those even. I tried to do in the Forumla node but I keep getting errors when odd definition [n], LabVIEW only accepts Odd [10] or any specific number, which is not very useful.

Simply use the array decimate function:

http://zone.NI.com/reference/en-XX/help/371361M-01/Glang/decimate_1d_array/

Tags: NI Software

Similar Questions

  • If/else statement in the MathScript node

    I want to write if/else statement in MathScript node.

    If (Yes is Yes)

    {

    a = 0;

    }

    other (no = no)

    {

    b = 1;

    }

    'Yes' and 'No'--> of Type String

    'a' and 'b'--> Type Double

    Hi johndoe.

    Thank you for contacting National instruments.

    I would like to highlight a number of items which you may find useful for the implementation of an if-else statement in a MathScript node.  The first is a book white tutorial, which the second part explains how to use LabVIEW MathScript node. The second is an article describing the required syntax to write functions and scripts in the MathScript node, including instructions for the use of the If-Else statements.

    I hope that these help. Please let me know if you need additional assistance.

    Kind regards

    James

  • Array of strings 1 d out of MathScript node

    I use arrays of cells inside a MathScript node and want to display an array of strings D 1.  I can't get output with this data type by selecting a column of string elements.  He seems to treat the strings as arrays of characters that are extremely difficult to work with.

    I've seen references 2008 who say that MathScript nodes cannot not out of arrays of strings,

    Is this always true?  Is there an example of how to get a string or some kind of workaround?

    My boss came up with a way to do it, as shown in the attached VI.

  • '' If '' dosnt works at the mathscript node

    Hello

    I have a strange problem in mathscript node, can u help me?

    I just wrote a simple conditional style in the mathscript node, but it dosent work and have attached the error! my software has problem?

    Best Regarsd

    Behzad

    The problem is that your "out" is not defined, as executed in your script. Maybe it's what you want instead

    out = - 1; % define value as default for the

    If in == 7

    out = 6;

    end

    Kevin C.

  • How to share a variable between the Mathscript Windows and a Mathscript node

    Hello

    I'm trying to share (just) a variable between the Mathscript Windows and a Mathscript node. I don't know why, but the use of the "global" Matlab function makes the mathscript node output formats change.

    I'm looking for a "Mathscript RT V9.0.1 module" as it may seem, there is. French technical support have some difficulty to find...

    Hi patrick33,.

    The code that you have attached should not report an error, so it seems that something has gone wrong with your installation of MathScript. My best guess is that it is the problem that is described in this knowledge base article. Your signature says that you use f3 patch, which is a good start. But the KB lists some other steps to take when you see errors about MathScript, impossible to compile. Can you try the procedure described in the article and let us know if that fixes the problem?

    Thank you

    jattas

    LabVIEW MathScript R & D

  • is it possible to use a file refnum as mathscript node entry

    Hello world

    I started using the LV and mathscript recently. A problem confuses me a lot.  It's

    Is it possible to use a file refnum as the entry or exit of the mathscript node? A picture is attached for your reference.

    Thank you very much!

    Gary

    What would you hope to do with the reference?  The Mathscript node is not a file of reading ability.  You must read the file and transmitting the data in the Mathscript node.

    EDIT: I was wrong.  You must use the functions fopen and fclose inside the MathScript node to be able to read a file inside.

  • MathScript node: an error internal mathscript: 64-bit LabVIEW 2009

    Hi people.

    I have an installation now LabVIEW 2009 9.03f, Vision and Advanced Signal Processing Toolkit, all 64-bit versions on a new computer, so that I can convert a code from 32 to 64-bit.

    I tell myself that I will address the errors one by one and this is the first.  I have a VI with mathscript node and the VI, who instructed and ran very well in the 32-bit environment, is now broken and giving the error "mathscript node: a mathscript internal error."  My main concern - is mathscript unsupported in LabVIEW 64-bit right now?

    I enclose the VI.  Any ideas are appreciated.  I need to get this working.

    In addition, NEITHER is there a special forum of 64-bit we should publish in the future, or create to post on?

    Sincerely,

    Don

    2009 help

    LabVIEW MathScript is a language based on text that you can use to write scripts and functions. You can process the scripts using LabVIEW MathScript in the Window of LabVIEW MathScript or a MathScript node. When you create a LabVIEW MathScript, you use data types supported.

    The MathScript syntax is intuitive and logical syntax essentially based on the standard mathematical and computer programming terms, mandate of widespread and common use truncation or descriptive abbreviations and concatenations of standardized terms. The Window of LabVIEW MathScript and MathScript nodes are able to process files that you create using the MathScript current syntax and, for backward compatibility, files that you created using legacy MathScript syntaxes. The Window of LabVIEW MathScript and nodes MathScript can also process some of your files using other textual syntaxes, such as files that you created by using the MATLAB® software. Because the MathScript RT Module engine is used to treat the scripts in the Window of LabVIEW MathScript and MathScript node, and the MathScript RT Module engine can't stand any of the syntaxes, not all existing text scripts are supported.

    (64-bit LabVIEW) LabVIEW MathScript is not supported in LabVIEW (64-bit).

  • Need help on how to create the transformation of the Park by using the MathScript node?

    Hello

    I want to generate a transformation of the Park by using the MathScript node. But there is an error message which confused me. Please can someone help me to have a look of my program? Thank you!

    The error message is "error-90011 occurred in error in the function mail to line 1.  The sizes of the input matrices are incompatible.
    Check that the matrices have the same size or one is a scalar.

    Possible reasons:

    LabVIEW: Sizes of the input matrices are incompatible.  Check that the matrices have the same size or that one is a scalar".

    Hello

    The problem is that all of your entries to the MathScript node are vectors.  All entries of the vector to the MathScript node becomes vector lines.  A multiplication of two vectors lines generates a size mismatch error.  If you really want a scalar of this multiplication of output (by calculating the dot product of vectors), then you have to bring your 'a', 'b' and 'c' vectors or your vector of 'x '.  If you want everything just multiply your elementwise vectors and produce an output vector, you must use the elementwise multiplication operator '. *' (time point).  Use this operator between your 'a', 'b' and 'c' vectors and your calculation of fishing.  For example, on your first line,
    d = (2/3)*a.*(sin(x))+(2/3)*b.*(sin(x-(2*pi/3)))+(2/3)*c.*(sin(x+(2*pi/3)));

    Don't forget to also change your output to a 1 d of DBL array variables.  You can do this by right-clicking on the output variable and selecting "Choose Data Type."

    Grant M.
    Staff software engineer | LabVIEW Math & Signal Processing | National Instruments

  • mathscript node Mac could not compile

    I just installed LabView 2009 SP1 on Mac OS X (Snow Leopard), as well as MathScript, who can't do much beyond a simple assignment.

    A simple if-else structure will work if it performs only scalar assignments, drunk, trying to create a simple 1 d of table within a node structure MathScript (x = 1:1:10) causes VI to break with the error ' MathScript node: VI failed to meet. "

    Similarly, try the following commands in a MathScript window all give "error at line 0: an internal error occurred during the processing of this MathScript.» Contact National Instruments with the MathScript you used. »

    t = 1:1:5

    t = linspace (1,5,1)

    help linspace

    It's not yet the command help. The only thing that works is something like x = 5 or x = sin (2.2 * pi).

    I am aware of these two articles, or which is applicable for Mac or for 2009 SP1:

    59AH3P4A Knowledge Base: Causes of failure Compiler Error with MathScript node

    553C13WI knowledge base: Detection screw instantiation corrupt and MathScript node failed to meet Er...

    The second section offers a few folders to delete, which I've tried. The other does not exist on install Mac. Needless to say that the utility to find corrupted instantiations is not useful here.

    Thanks in advance for your suggestions.

    Tom

    Inches,

    Is that you improved in 2009 SP1 MathScript RT? The 2009 version of MathScript won't work with LabVIEW 2009 SP1.

    Thank you

    Scott K

  • mathscript node can work on arrays?

    on the help page Labview titled "Setting up the data type of the script node terminals", there is a line that says "because the MathScript node behaves differently that other nodes in script, you cannot change the data type of input terminals. Instead, if wire you a data type not supported for input on a node MathScript, LabVIEW converts the data type to a supported type or displays a cut wire. If LabVIEW converts the data type, a point constraint appears on the terminal where takes place the conversion. After that wire you an entry to a MathScript node, right-click the input terminal and select Show data of Type from the context menu to see the data type of the entry. »

    I don't understand this.

    I want to do math on arrays / vectors using mathscript. This means that I need input terminals in order to have a table data type.

    Say for example I have A [1 2 3 4 5] = (perhaps from a table of average data for 5 different channels) and say that I want to B = a ^ 2 (using the matlab syntax) - I can do this with a mathscript node?

    If this isn't the case, means that I can't do any math vector/matrix using the mathscript node? given that the whole point of matlab is to work on vectors and matrices, if mathscript node cannot do what it would also be a severe limitation.

    Dave

    Yes, you can use arrays in a MathScript node. Just create an entry on the node, give it a name and a value of table of wire to this entry.

  • Change the working directory of the MathScript node in the working directory of the VI in which the node is added

    Hello

    I want to automatically change the working directory of the node Mathscript in a VI in the working directory of the VI, while I don't have to specify every time where is my file ".m", as most likely, it will be in the same folder as the VI.

    Thank you

    Walid F. van

    Hi Wade,

    The following picture illustrates how to add the directory to your VI to MathScript search paths.

  • Replacement of the nodes with duplicates

    I can't find out how to write an XQuery query which can essentially 'jump' a replacement when I said to. I don't know who makes no sense, so here's a better explanation.

    I have an XML file that is stored in an Oracle XML DB that looks like this:
    <bookstore>
        <book title="Analytical Chemistry" publish_date="198710">
           <author>...
           <publisher>....
           <etc.>
        </book>
        <book title="Particle Physics" publish_date="199202">
           <author>...
           <publisher>....
           <etc.>
        </book>
        <book title="Applied Biophysics" publish_date="201005">
           <author>...
           <publisher>....
           <etc.>
        </book>
    </bookstore>
    We get the update commands that look like the same thing, with a 'command' attached to add the book to the store or drop:
    <bookstore>
        <book title="Analytical Chemistry" publish_date="199210">
           <order>merge</order>
           <author>...
           <publisher>....
           <etc.>
        </book>
        <book title="Particle Physics" publish_date="199202">
           <order>drop</order>
           <author>...
           <publisher>....
           <etc.>
        </book>
        <book title="Chaos Theory" publish_date="199102">
           <order>merge</order>
           <author>...
           <publisher>....
           <etc.>
        </book>
    </bookstore>
    The rule is should I replace or add a book in the store if I have a book of the same title, and the order is "merge", or drop it if the order is to 'drop '. I have a request XQuery Update function now makes what looks like this:
    declare updating function local:book_merge($old, $book_merge)
    {
         for $orderEntr in $book_merge/book
         let $chgCd := $orderEntr/order
         let $orderTitle := $orderEntr/@title
            let $oldBooks := $old/bookstore
         let $oldBookEntr := $oldBooks/book[@title=$orderTitle]
         return
            if( $chgCd = "drop" and exists($oldBookEntr) )
            then delete node $oldBookEntr
            else if( exists($oldBookEntr) )
            then replace node $oldBookEntr with $orderEntr
            else insert node $orderEntr into $oldBooks
    };
    This works very well for commands like above, but once from time to time, we receive a command like this:
    <bookstore>
       <book title="Analytical Chemistry" publish_date="199210">
           <order>merge</order>
           <author>...
           <publisher>....
           <etc.>
        </book>
        <book title="Analytical Chemistry" publish_date="199210">
           <order>merge</order>
           <author>...
           <publisher>....
           <etc.>
        </book>
        <book title="Particle Physics" publish_date="199202">
           <order>drop</order>
           <author>...
           <publisher>....
           <etc.>
        </book>
        <book title="Chaos Theory" publish_date="199102">
           <order>merge</order>
           <author>...
           <publisher>....
           <etc.>
        </book>
    </bookstore>
    Notice how the first entry is duplicated. In this case, the requirement must only enter the book in the library once. Can someone give me an idea of how I would go about implementing that? I am struggling to understand how to ask the right question, so please forgive me.

    You can add a predicate that will filter the next (or previous) duplicates of a given input:

    where not($orderEntr/following-sibling::book[@title = $orderTitle])
    

    Full test case:

    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    
    SQL> create table tmp_xml of xmltype;
    
    Table created.
    
    SQL> insert into tmp_xml values (
      2  xmltype('
      3      
      4         XXX
      5         
      6      
      7      
      8         YYY
      9         
     10      
     11      
     12         ZZZ
     13         
     14      
     15  ')
     16  );
    
    1 row created.
    
    SQL> var orders clob
    SQL> begin
      2
      3   :orders := '
      4      
      5         merge
      6         XXX
      7         123
      8      
      9      
     10         merge
     11         XXX
     12         123
     13      
     14      
     15         drop
     16         YYY
     17         
     18      
     19      
     20         merge
     21         ZZZ-2
     22         
     23      
     24  ';
     25
     26  end;
     27  /
    
    PL/SQL procedure successfully completed.
    
    SQL> set long 5000
    SQL> set pages 100
    SQL>
    SQL> select /*+ no_xml_query_rewrite */
      2         xmlserialize(document
      3           xmlquery(
      4           'copy $d := $old
      5            modify (
      6              for $orderEntr in $orders/bookstore/book
      7              let $chgCd := $orderEntr/order
      8              let $orderTitle := $orderEntr/@title
      9              let $oldBooks := $d/bookstore
     10              let $oldBookEntr := $oldBooks/book[@title = $orderTitle]
     11              where not($orderEntr/following-sibling::book[@title = $orderTitle])
     12              return
     13                 if( $chgCd = "drop" and exists($oldBookEntr) )
     14                   then delete node $oldBookEntr
     15                 else if( exists($oldBookEntr) )
     16                        then replace node $oldBookEntr with $orderEntr
     17                      else insert node $orderEntr into $oldBooks
     18            )
     19            return $d'
     20           passing object_value as "old"
     21                 , xmlparse(document :orders) as "orders"
     22           returning content
     23           )
     24           indent
     25         ) as result
     26  from tmp_xml ;
    
    RESULT
    --------------------------------------------------------------------------------
    
      
        merge
        XXX
        123
      
      
        ZZZ
        
      
      
        merge
        ZZZ-2
        
      
    
    

    It's another question, you probably already have the answer: I guess you must also remove the nodes of the newly merged books?

  • Is it possible to print the mathscript with color-coding text node?

    MathScript nodes lie down, I need to be able to make temporary annotations on paper.  Currently, the only way I can find to print the MathScript node is by screen capture and printing an image.

    While I can copy the text and put it in a word processing program, I would lose all the useful color coding.

    Y at - it a tip to copy as text and preserve color-coding?

    Download and install the notebook of the programmer.

    Copy all the text of the Mathscript node and paste it into Notepad to the programmer.

    In the menu bar - view - check syntax highlighting

    In the menu bar - display - regime change - select Matlab

    In the menu - Tools - Options - fonts and colors - bar you can select a larger font size

    (Although my vision is corrected to 20/10 and I have a lot of difficulty to read tiny fonts in the Mathscript node on a screen high resolution after a couple of hours.)

    This software is free and has a full set of features for serious programmers.

  • store internal variables in the nodes mathscript/scilab

    Is it possible to store the values of local variables in mathscript node? Maybe have an initialization section where variables are implemented and then later updated. And then something to reset the closure of the vi? Im guessing not, im guessing that we must do the same as labview, pass new releases at the entrances, but it is much more natural in a text based language to do it this way (for me anyway).

    Gordal salvation,

    You can use the backup and loading of orders to store variables for your scripts in a file.  Note that these commands will a warning glyph occur which reduces performance, so what I propose is the following:

  • MathScript module required for the performance of nodes?

    I am considering buying the mathscript module but have a question that I can't find an answer to.  Once a program including mathscript node has been developed, it can be run with a LabVIEW license that does not include the module?  I write software for customers who are not currently that this module and want to make sure that it will be able to use the program without purchasing the add-on.  Is this possible without creating an .exe?

    When you have a VI that includes the Mathscript RT module, any time you want to open and run VI only, it must be on a computer with LabVIEW and the MathScript RT Module. Once VI is built in a .exe then it can run on a computer with only the runtime engine.

    If you need end-user to modify a VI that uses your RT code, you could always build the VI in a DLL, and the end user can access this DLL and feed in the parameters and results.

Maybe you are looking for