• 大小: 207KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-05-11
  • 语言: Matlab
  • 标签: svpwm  

资源简介

svpwm的MATLAB仿真Word文件和MATLAB仿真模块,读者下载后直接可以运行

资源截图

代码片段和文件信息


function makeInfo=rtwmakecfg()
%RTWMAKECFG adds include and source directories to rtw make files.
%  makeInfo=RTWMAKECFG returns a structured array containing
%  following field:
%     makeInfo.includePath - cell array containing additional include
%                            directories. Those directories will be
%                            expanded into include instructions of rtw
%                            generated make files.
%
%     makeInfo.sourcePath  - cell array containing additional source
%                            directories. Those directories will be
%                            expanded into rules of rtw generated make
%                            files.
makeInfo.includePath = {};
makeInfo.sourcePath  = {};


%

sfBuilderBlocksByMaskType = find_system(bdroot‘MaskType‘‘S-Function Builder‘);
sfBuilderBlocksByCallback = find_system(bdroot‘OpenFcn‘‘sfunctionwizard(gcbh)‘);
sfBuilderBlocks = {sfBuilderBlocksByMaskType{:} sfBuilderBlocksByCallback{:}};
sfBuilderBlocks = unique(sfBuilderBlocks);
if isempty(sfBuilderBlocks)
   return;
end
for idx = 1:length(sfBuilderBlocks)
   sfBuilderBlockNameMATFile{idx} = get_param(sfBuilderBlocks{idx}‘FunctionName‘);
   sfBuilderBlockNameMATFile{idx} = [‘.‘ filesep ‘SFB__‘ char(sfBuilderBlockNameMATFile{idx}) ‘__SFB.mat‘];
end
sfBuilderBlockNameMATFile = unique(sfBuilderBlockNameMATFile);
for idx = 1:length(sfBuilderBlockNameMATFile)
   if exist(sfBuilderBlockNameMATFile{idx})
      loadedData = load(sfBuilderBlockNameMATFile{idx});
      if isfield(loadedData‘SFBInfoStruct‘)
         makeInfo = UpdateMakeInfo(makeInfoloadedData.SFBInfoStruct);
         clear loadedData;
      end
   end
end

function updatedMakeInfo = UpdateMakeInfo(makeInfoSFBInfoStruct)
updatedMakeInfo = {};
if isfield(makeInfo‘includePath‘)
   if isfield(SFBInfoStruct‘includePath‘)
      updatedMakeInfo.includePath = {makeInfo.includePath{:} SFBInfoStruct.includePath{:}};
   else
      updatedMakeInfo.includePath = {makeInfo.includePath{:}};
   end
end
if isfield(makeInfo‘sourcePath‘)
   if isfield(SFBInfoStruct‘sourcePath‘)
      updatedMakeInfo.sourcePath = {makeInfo.sourcePath{:} SFBInfoStruct.sourcePath{:}};
   else
      updatedMakeInfo.sourcePath = {makeInfo.sourcePath{:}};
   end
end
if isfield(SFBInfoStruct‘additionalLibraries‘)
   % Copy over library and object files from their source folders to a
   % folder one folder above the *_target_rtw/ folder
   for idx=1:length(SFBInfoStruct.additionalLibraries)
      try
         if ~copyfile(SFBInfoStruct.additionalLibraries{idx})
            warning(‘Simulink:SFBuilder:rtwmakecfgCopyFailed‘ ...
                    sprintf(‘failed to copy %s to the current folder %s\n‘...
                    SFBInfoStruct.additionalLibraries{idx} pwd));
         end
      catch %Try catch is to avoid any hard errors due to copyfile
      end
   end
end

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2014-05-18 13:37  svpwm的MATLAB仿真实现\
     目录           0  2014-05-18 13:38  svpwm的MATLAB仿真实现\MATLAB\
     文件       35084  2014-05-18 13:38  svpwm的MATLAB仿真实现\MATLAB\p.mdl
     文件        2998  2014-05-17 19:34  svpwm的MATLAB仿真实现\MATLAB\rtwmakecfg.m
     文件         224  2014-05-18 13:27  svpwm的MATLAB仿真实现\MATLAB\SFB__svpwm__SFB.mat
     文件        6435  2014-05-18 13:27  svpwm的MATLAB仿真实现\MATLAB\svpwm.c
     文件       78336  2014-05-18 13:27  svpwm的MATLAB仿真实现\MATLAB\svpwm.dll
     文件        1619  2014-05-18 13:27  svpwm的MATLAB仿真实现\MATLAB\svpwm.tlc
     文件        2867  2014-05-18 13:27  svpwm的MATLAB仿真实现\MATLAB\svpwm_wrapper.c
     文件      165954  2014-05-18 13:37  svpwm的MATLAB仿真实现\SVPWM-matlab仿真.doc

评论

共有 条评论