setFileExtension
设置 FileExtensions 中指定文件类型的文件扩展名
语法
h.setFileExtension(name,value)
输入参数
示例
获取默认编译工具并设置其属性
以下示例代码显示向 MATLAB® Coder™ 编译过程添加自定义工具链教程中 intel_tc.m 文件的一部分中的 setFileExtension。
% ------------------------------
% C Compiler
% ------------------------------
tool = tc.getBuildTool('C Compiler');
tool.setName('Intel C Compiler');
tool.setCommand('icl');
tool.setPath('');
tool.setDirective('IncludeSearchPath','-I');
tool.setDirective('PreprocessorDefine','-D');
tool.setDirective('OutputFlag','-Fo');
tool.setDirective('Debug','-Zi');
tool.setFileExtension('Source','.c');
tool.setFileExtension('Header','.h');
tool.setFileExtension('Object','.obj');
tool.setCommandPattern('|>TOOL<| |>TOOL_OPTIONS<| |>OUTPUT_FLAG<||>OUTPUT<|');
以交互方式使用 setFileExtension
tc = coder.make.ToolchainInfo; tool = tc.getBuildTool('C Compiler'); blditm = coder.make.BuildItem('CD','.cd')
bldtm = Macro : CD Value : .cd
tool.addFileExtension('SourceX',blditm) value = tool.getFileExtension('SourceX')
value = .cd
tool.setFileExtension('SourceX','.ef') value = tool.getFileExtension('SourceX')
value = .ef
版本历史记录
在 R2013a 中推出