%#exclude
설명
%#exclude fileOrFunction1 [fileOrFunction2 ... fileOrFunctionN]
프라그마는 지정된 파일이나 함수를 컴파일 중에 종속성 분석에서 제외해야 함을 컴파일러에게 알려줍니다. 또한 이 프라그마는 파일이나 함수를 컴파일할 수 없다는 컴파일타임 경고를 표시하지 않습니다.
예제
배포 불가능한 함수에 %#exclude
및 isdeployed
사용하기
배포 불가능한 함수 edit
의 컴파일타임 경고를 표시하지 않으려면 isdeployed
를 %#exclude
프라그마와 함께 사용합니다.
if ~isdeployed %#exclude edit edit('readme.txt'); end
~isdeployed
문은 배포된 컴포넌트에서 코드가 호출되는 것을 방지합니다. %#exclude
프라그마는 edit
를 컴파일할 수 없다는 경고를 표시하지 않습니다.
데이터 파일에 %#exclude 사용하기
프라그마를 사용하여 파일을 포함하고 제외하는 MATLAB® 함수를 만듭니다.
2개의 프라그마를 사용하는
testExclusion
이라는 이름의 함수를 작성합니다.function testExclusion() %#exclude foo.mat load foo.mat load bar.mat %#function foo.txt fid = fopen('foo.txt'); fclose(fid)
%#exclude
프라그마는 컴파일 중에 파일foo.mat
을 제외하라고 컴파일러에게 알립니다.%#function
프라그마는 컴파일 중에 파일foo.txt
를 포함해야 한다고 컴파일러에게 알립니다.mcc
를 사용하여 함수를 독립 실행형 애플리케이션으로 컴파일합니다.-m
옵션은 독립형 실행 파일을 빌드합니다.-a
옵션은 파일을 배포 가능한 아카이브에 추가합니다.-X
옵션은mcc
에게 종속성 분석 중에 데이터 파일을 무시하도록 지시합니다.mcc -m testExclusion.m
을 실행하면 결과는 다음과 같습니다.종속성 분석 중에
bar.mat
와foo.txt
포함됨foo.mat
제외됨
mcc -m testExclusion.m -X
를 실행하면 결과는 다음과 같습니다.종속성 분석 중에
foo.txt
포함됨bar.mat
와foo.mat
제외됨
mcc -m testExclusion.m -X -a foo.mat
를 실행하면 결과는 다음과 같습니다.종속성 분석 중에
foo.mat
와foo.txt
포함됨bar.mat
제외됨
마지막 경우에는
-a
옵션이%#exclude
프라그마보다 우선합니다.
버전 내역
R2020a에 개발됨
참고 항목
mcc
| %#function
| isdeployed
MATLAB 명령
다음 MATLAB 명령에 해당하는 링크를 클릭했습니다.
명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 MATLAB 명령을 지원하지 않습니다.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)