How can I extract Parameter Overrides from a Simulink test file?

Illustration
teenanath - 2021-08-27T12:22:10+00:00
Question: How can I extract Parameter Overrides from a Simulink test file?

I have a Simulink test file (.MLDATX), which I would like to extract Parameter Overrides from (and store in a table, for example).   How can I do this?

Expert Answer

Profile picture of John Williams John Williams answered . 2025-11-20

Parameter Overrides can be extracted from a test file using functionality from the "sltest.testmanager" package, for example:
 
 
% Load an instance of the test file
testfile = sltest.testmanager.TestFile('./mytestfile.mldatx', false);
 
% Extract and loop over test suites
testsuites = getTestSuites( testfile ); 
for suite = testsuites
    % Extract and loop over test cases
    testcases = getTestCases( suite );
    for testcase = testcases
        % Extract and loop over parameter sets
        paramsets = getParameterSets( testcase );
        for paramset = paramsets
            % Extract and loop over parameter overrides
            paramoverrides = getParameterOverrides ( paramset );
            for paramoverride = paramoverrides
                % Use the Parameter Overrides
                disp( paramoverride.Name )
                disp( paramoverride.Value )
            end
        end
    end
end


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!