Build Interface to school
Library
Validate Edits to Library Definition File
In the previous step, you modified the library definition file. To verify the MATLAB® statements, validate the file and fix any reported errors in the file.
defineschool;
View Functionality
If you defined all constructs in the definition file in the previous step, then the
summary
function
shows the complete library. In some cases, you might not define everything. Use
summary
to review the library. If you need to make changes, return to
the previous step to edit defineschool
.
summary(defineschool)
MATLAB Interface to school Library Class clib.school.Person Constructors: clib.school.Person() clib.school.Person(string,uint64) clib.school.Person(clib.school.Person) Methods: setName(string) setAge(uint64) string getName() uint64 getAge() No Properties defined Class clib.school.Teacher Constructors: clib.school.Teacher() clib.school.Teacher(string,uint64) clib.school.Teacher(clib.school.Teacher) Methods: string getName() No Properties defined Class clib.school.Student Constructors: clib.school.Student() clib.school.Student(string,uint64) clib.school.Student(clib.school.Student) Methods: string getName() No Properties defined Functions string clib.school.getName(clib.school.Person)
Build Interface and Add to MATLAB Path
Build the school
interface to the library.
build(defineschool)
Building interface file 'schoolInterface.dll' for clib package 'school'. Interface file 'schoolInterface.dll' built in folder 'C:\Users\Documents\MATLAB\school'. To use the library, add the interface file folder to the MATLAB path. addpath('C:\Users\Documents\MATLAB\school')
Add the library to your path. Either click the link in the message or type:
addpath('school')
Note
You can repeat the generate, define, and build steps. However, once you display help
for or call functions in the library, you cannot update the
defineschool
definition file or rebuild in the same MATLAB session. Either restart MATLAB or create a new definition file by using the PackageName
name-value argument for the clibgen.generateLibraryDefinition
function.
To call functions in the library, continue with the next step.