www.gusucode.com > polyspace_bf 案例源码 matlab代码程序 > polyspace_bf/GenerateProjectFromABugFinderOptionsObjectExample.m

    %% Generate Project from a Bug Finder Options Object
% This example shows how to create and use a Polyspace project that was
% generated from an options object.

%%
% Create a Bug Finder object and set properties.
sources = fullfile(matlabroot, 'polyspace','examples','cxx','Bug_Finder_Example','sources','numerical.c');
optsBF = polyspace.BugFinderOptions();
optsBF.Prog = 'MyProject';
optsBF.Sources = {sources};
optsBF.TargetCompiler.Compiler = 'gnu4.7';

%%
% Generate a Polyspace project. Name the project using the name of the Prog.
psprj = generateProject(optsBF, optsBF.Prog);

%%
% Run an analysis with one of the commands below.  Both commands produce identical analysis results.
%  The only difference is that the the psprj project can be rerun in the
%  Polyspace interface.
polyspaceBugFinder(psprj, '-nodesktop');

%%
polyspaceBugFinder(optsBF);