Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
This Document is not yet Rated  Rate this Document

Do I Have to Fill in All the Parameters of a HiQ Function?

Primary Software: Other NI Software>>HiQ
Primary Software Version: 4.1
Primary Software Fixed Version: N/A
Secondary Software: N/A

Problem: Some HiQ functions have many different parameters, some of which I do not want to specify. How can I only fill in the parameters that I want to change?

Solution: For HiQ functions you only have to specify the required parameters and the optional parameters you would like to change.

To demonstrate how this is done, we will use the optimize function as an example. Here is the full parameter list for optimize:

[fmin, xmin, nIter, kgTolr, kxTolr] = optimize(sFct, x0, uType, gTolr, xTolr, maxIter, grdSFct, callback)

If you do not want to use all the values returned by the function, here are some of the things you can do.
  • To return only the first value (fmin) you do not need to add anything, just list only the first value: fmin = optimize()
  • To access other return values, use commas to replace any preceding values. For example, to return xmin or nIter, use this syntax:

    [,xmin] = optimize() or [,,nIter] = optimize()

  • To return multiple values, use the same procedure. For instance, if you want to return both fmin and nIter, use this syntax:

    [fmin,,nIter] = optimize()

  • If you do not want to input all the optional parameters, then using commas as fillers also works in the parameter list. For the optimize function, "sFct" and "x0" are required and everything else is optional. To set the maximum iterations (maxIter) but nothing else, use commas to fill in the optional parameters you do not want to modify. Check out this example syntax:

    fmin = optimize(sFct, x0,,,,maxIter).

  • Finally, this syntax shows in a general case how to return and set only the parameters you want:

    [fmin,,nIter] = optimize(sFct, x0,,gTolr,,maxIter,,callback)


Note: National Instruments does not support HiQ functionality on Mac OS in LabVIEW 7.0 and will no longer support HiQ functionality on all platforms after LabVIEW 7.0. If your application uses HiQ VIs, consider replacing them with the Analyze and Mathematics VIs. Refer to the LabVIEW Help for information about using the Analyze and Mathematics VIs. You access the LabVIEW Help by selecting Help»VI, Function, & How-To Help.

Related Links: HiQ Support


Attachments:





Report Date: 01/31/2001
Last Updated: 12/02/2004
Document ID: 25U7Q2PQ

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit