공유 라이브러리 shrlibsample
MATLAB®은 shrlibsample
이라고 하는 외부 샘플 라이브러리를 포함합니다. 이 라이브러리는
폴더에 있습니다.matlabroot
\extern\examples\shrlib
MATLAB에서 소스 코드를 확인해 봅니다.
edit([matlabroot '/extern/examples/shrlib/shrlibsample.c']) edit([matlabroot '/extern/examples/shrlib/shrlibsample.h'])
shrlibsample
라이브러리를 사용하려면 다음 중 하나를 선택하십시오.
폴더를 MATLAB 경로에 추가합니다.
addpath(fullfile(matlabroot,'extern','examples','shrlib'))
폴더를 현재 작업 폴더로 만듭니다.
cd(fullfile(matlabroot,'extern','examples','shrlib'))
라이브러리를 불러오고 라이브러리의 함수에 대한 MATLAB 시그니처를 표시합니다.
loadlibrary('shrlibsample') libfunctions shrlibsample -full
Functions in library shrlibsample: [double, doublePtr] addDoubleRef(double, doublePtr, double) double addMixedTypes(int16, int32, double) [double, c_structPtr] addStructByRef(c_structPtr) double addStructFields(c_struct) c_structPtrPtr allocateStruct(c_structPtrPtr) voidPtr deallocateStruct(voidPtr) lib.pointer exportedDoubleValue lib.pointer getListOfStrings doublePtr multDoubleArray(doublePtr, int32) [lib.pointer, doublePtr] multDoubleRef(doublePtr) int16Ptr multiplyShort(int16Ptr, int32) doublePtr print2darray(doublePtr, int32) printExportedDoubleValue cstring readEnum(Enum1) [cstring, cstring] stringToUpper(cstring)