Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Create a Function for Checking Multiple Systems in Parallel

If you have a Parallel Computing Toolbox™ license and a multicore host machine, you can create the following function to check multiple systems in parallel:

  1. Create the run_configuration function.

  2. Save the function as run_fast_configuration.m.

  3. In the Editor, change the name of the function to run_fast_configuration.

  4. In the ModelAdvisor.run function, set 'ParallelMode' to 'On' . When you use ModelAdvisor.run with ‘ParallelMode' set to ‘On', MATLAB® automatically creates a parallel pool.

    SysResultObjArray = ModelAdvisor.run(SysList,'Configuration',fileName,...
        'ParallelMode','On');

    The function should now look like this:

    function [fail, warn] = run_fast_configuration(SysList)
    %RUN_FAST_CONFIGURATION Check systems in parallel with Model Advisor
    %   Return number of warnings and failures.
    fileName = 'slvnvdemo_mdladv_config.mat';
    fail=0;
    warn=0;
    
    SysResultObjArray = ModelAdvisor.run(SysList,'Configuration',fileName,...
        'ParallelMode','On');
    
    for i=1:length(SysResultObjArray)
        fail = fail + SysResultObjArray{i}.numFail;
        warn = warn + SysResultObjArray{i}.numWarn;
    end
    
    end
    

  5. Save the function.

  6. Test the function. In the MATLAB Command Window, create a list of systems:

    SysList={'sldemo_auto_climatecontrol/Heater Control',...
        'sldemo_auto_climatecontrol/AC Control','rtwdemo_iec61508'};

  7. Run run_fast_configuration on the list of systems:

    [failures, warnings] = run_fast_configuration(SysList);

  8. Review the results. Click the Summary Report link to open the Model Advisor Command-Line Summary report.

See Also

Related Topics

Was this topic helpful?