没有合适的资源?快使用搜索试试~ 我知道了~
首页MATLAB的C++ 数学库使用手册
The MATLAB® C++ Math Library serves two separate constituencies:<br>MATLAB programmers seeking more speed or complete independence from<br>interpreted MATLAB, and C++ programmers who need a fast, easy-to-use<br>matrix math library. To each, it offers distinct advantages.
资源详情
资源评论
资源推荐

The Language of Technical Computing
Computation
Visualization
Programming
MATLAB
®
C++
Math Library
User’s Guide
Version 2.1

How to Contact The MathWorks:
508-647-7000 Phone
508-647-7001 Fax
The MathWorks, Inc. Mail
3AppleHillDrive
Natick, MA 01760-2098
http://www.mathworks.com Web
ftp.mathworks.com Anonymous FTP server
comp.soft-sys.matlab Newsgroup
support@mathworks.com Technical support
suggest@mathworks.com Product enhancement suggestions
bugs@mathworks.com Bug reports
doc@mathworks.com Documentation error reports
subscribe@mathworks.com Subscribing user registration
service@mathworks.com Order status, license renewals, passcodes
info@mathworks.com Sales, pricing, and general information
MATLAB C++ Math Library User’s Guide
COPYRIGHT 1984 - 2000 by The MathWorks, Inc.
The software described inthisdocument is furnished under a license agreement. The software may be used
or copied only under the terms of the license agreement. No part of this manual may be photocopied or repro-
duced in any form without prior written consent from The MathWorks, Inc.
FEDERAL ACQUISITION: This provision applies to all acquisitions of the Program and Documentation by
or for the federal government of the United States. By accepting delivery of the Program, the government
hereby agrees that this software qualifies as "commercial" computer software within the meaning of FAR
Part12.212,DFARS Part227.7202-1,DFARS Part227.7202-3, DFARS Part252.227-7013, and DFARSPart
252.227-7014. The terms and conditionsof The MathWorks, Inc. Software License Agreement shall pertain
to the government’s use and disclosure of the Program and Documentation, and shall supersede any
conflicting contractual terms or conditions. If this license fails to meet the government’s minimum needs or
is inconsistent in any respect with federal procurement law, the government agrees to return the Program
and Documentation, unused, to MathWorks.
MATLAB, Simulink, Stateflow, Handle Graphics, and Real-Time Workshop are registered trademarks, and
Target Language Compiler is a trademark of The MathWorks, Inc.
Other product or brand names are trademarks or registered trademarks of their respective holders.
Printing History: October 1995 First printing
January 1998 Revised for Version 1.2
January 1999 Revised for Version 2.0 (Release 11)
September 2000 Revised for Version 2.1 (Release 12) Online only

i
Contents
1
Getting Started
Introduction ......................................... 1-2
OverviewoftheMATLABC++MathLibrary.............. 1-2
WhoShouldReadThisBook............................ 1-4
NewMATLABC++MathLibraryFeatures ............... 1-5
MATLABC++MathLibraryDocumentation .............. 1-5
GettingStartedQuickly ............................... 1-8
Installing the C++ Math Library ........................ 1-9
Installation with MATLAB . . . . . . . . . . . .................. 1-9
Installation Without MATLAB . . . . . . . . ................. 1-10
VerifyingaUNIXInstallation ......................... 1-10
Verifying a PC Installation . . . . . . . . . . . ................. 1-10
Installing Your C++ Compiler . . . . . . . . ................. 1-11
Building C++ Applications ............................ 1-13
Overview .......................................... 1-13
Building a Stand-Alone Application on UNIX .......... 1-15
ConfiguringtheBuildEnvironment .................... 1-15
BuildinganApplication .............................. 1-18
mbuildOptions ..................................... 1-20
Building a Stand-Alone Application on PCs ............ 1-23
ConfiguringtheBuildEnvironment .................... 1-23
BuildinganApplication .............................. 1-29
mbuildOptions ..................................... 1-30
Troubleshooting mbuild .............................. 1-33
Linking Applications Without mbuild ................. 1-35
Distributing Stand-Alone Applications ................ 1-36
Packaging the MATLAB Math Run-Time Libraries . . . . . . . . 1-36

ii Contents
Installing Your Application . ........................... 1-37
ProblemStartingStand-AloneApplication ............... 1-38
2
Fundamentals
MATLAB Basics ....................................... 2-3
DataTypes .......................................... 2-3
Operators ........................................... 2-4
Functions ........................................... 2-6
InputandOutput..................................... 2-6
Errors .............................................. 2-7
FlowofControl....................................... 2-7
MATLAB for C++ Programmers ......................... 2-8
C++ for MATLAB Users ............................... 2-10
HowtheLibraryIsSimilartoMATLAB ................. 2-10
HowC++andtheLibraryDifferfromMATLAB ........... 2-10
MATLAB C++ Math Library Basics ..................... 2-12
DataTypes ......................................... 2-12
Operators .......................................... 2-13
Functions .......................................... 2-14
InputandOutput.................................... 2-15
Errors ............................................. 2-16
MemoryManagement ................................ 2-16
Stand-Alone Programs ................................ 2-18
Example Program: Writing Simple Functions (ex4.cpp) . . . . . 2-19
WritingEfficientPrograms ............................ 2-22
Learning More ....................................... 2-24

iii
3
Working with MATLAB Arrays
Overview ............................................. 3-2
SupportedMATLABArrayTypes........................ 3-2
MATLABArrayC++Object ............................ 3-3
Numeric Arrays ....................................... 3-4
CreatingNumericArrays .............................. 3-5
InitializingaNumericArraywithData.................. 3-13
Example Program: Creating Arrays and Array I/O (ex1.cpp) . 3-15
Sparse Matrices ...................................... 3-19
CreatingaSparseMatrix ............................. 3-20
Converting a Sparse Matrix to Full Matrix Format . . . . . . . . 3-23
EvaluatingArraysforSparseStorage ................... 3-23
Character Arrays .................................... 3-24
CreatingMATLABCharacterArrays.................... 3-25
Cell Arrays .......................................... 3-28
CreatingCellArrays ................................. 3-28
DisplayingtheContentsofaCellArray.................. 3-33
MATLAB Structures .................................. 3-35
CreatingStructures .................................. 3-35
Performing Common Array Programming Tasks ........ 3-39
ConvertingDatatoMATLABArrays .................... 3-39
DeterminingArraySize............................... 3-42
4
Indexing into Arrays
Overview ............................................. 4-2
Terminology ......................................... 4-2
DimensionsandSubscriptsinMATLAB .................. 4-2
剩余389页未读,继续阅读
安全验证
文档复制为VIP权益,开通VIP直接复制

评论2