Databases Reference
In-Depth Information
'Start looking for results now!
trip = True
End If
Next index
End If
If the residuals are not to be calculated, this section of code will allow the macro to skip over
processing the residual results.
'No Residuals to Calculate - Exit Sub
If frm9MLRC.ResidualCheckBox.Value = "False" Then GoTo
Quit_Now:
The final section of code terminates the Matlab ActiveX Server (very important as it frees up
system resources), closes and unloads the GUI, and terminates the macro.
Quit_Now:
MatLab.Quit ' Quit method to close the application
Set MatLab = Nothing 'this releases the reference.
frm9MLRC.Hide
Unload frm9MLRC
End Sub
9.7
INTERFACING EXCEL AND ORIGIN TO PERFORM
MORE COMPLEX ANALYSES
Another very powerful computational tool is OriginLab's Origin. Although Matlab is a matrix- and
vector-based calculation tool, Origin is a spreadsheet-based computational tool like Excel. Origin
has the ability to open Excel spreadsheets in its native environment and, like Excel, has a macro
language that allows automation. The similarities end there, however.
Unlike Excel, Origin has presentation -quality graphics. Origin's scripting language, termed
Labtalk, is C-based, unlike Excel's scripting language that is a derivative of BASIC. As a matter
of practicality, the learning curve to automate data analysis applications in Origin is several times
more steep than learning how to automate data analysis applications in Excel. However, it is also
equally true that Origin has much greater capabilities than Excel in terms of the complexity of the
computational tools offered within the package, and the quality and flexibility of its graphics.
Origin's scripting abilities span across two domains. The first is Labtalk, the first and original
macro language available from within Origin. Although Labtalk is an extremely robust language
modeled on C, it is not as robust as a natively compiled language such as C. To help improve
performance and increase the scripting capabilities, Origin C was developed. Origin C runs much
faster than Labtalk but not quite as fast as a regular C compiler. In addition to regular C constructs,
Origin C has unique commands specific for use in the Origin environment. Origin C can, in fact,
utilize Labtalk commands within Origin C, and Origin C functions can be called from Labtalk
within Origin. This interoperability provides a great deal of flexibility when it comes to constructing
constructs and algorithms for automation purposes.
It is beyond the scope of this text to fully teach the reader all the intricacies of Labtalk and
Origin C. However, to utilize the Origin computational engine, some knowledge of both languages
is required. The text will delve into Labtalk and Origin C only to the extent necessary to produce
routines that can be called by Excel to perform nonlinear curve fitting, filtering, or other higher-level
Search WWH ::




Custom Search