image thumbnail
from sldvmisscovtool by Yasumitsu Ito
A GUI tool to obtain test cases for missing coverage objectives

importMATfile.m
function [simdata,testcasename] = importMATfile(Mode,filename)
% sldvmisscovtoolp ͊֐ (MAT-t@C̃C|[g)
%

%   Copyright 2010-2011 The MathWorks, Inc. 

switch Mode
    case 'description'
        if any(strcmp(get(0,'lang'),{'ja_jp.shift_jis','japanese','ja_jp'}))
            simdata = 'MAT-t@C';
            testcasename = ['[C|[g]' 10 ...
                'C|[g{^NbNɂAIMAT-t@CeXgP[Xǂݍ݂܂BMAT-t@Cɂ simdata ϐۑĂKv܂B'];
        else
            simdata = 'From MAT-file';
            testcasename = ['[Import]' 10 ...
                'Import from MAT-file in which simdata variable (time with structure format) is stored.'];
        end
    case 'import'
        testcasename=[];
        if ~exist('filename','var')
            % Read data by MAT-file which contains a simulink structure with time (time, signals)
            [flname,dirname]=uigetfile('*.mat');
            if flname==0
                simdata = [];
                testcasename = 'Canceled';
                return;
            end
            filename = fullfile(dirname,flname);
        end

        load(filename);
        if ~exist('simdata','var')
            simdata =[];
            if any(strcmp(get(0,'lang'),{'ja_jp.shift_jis','japanese','ja_jp'}))
                testcasename ='ϐsimdataMAT-fileɊ܂܂Ă܂B';
            else
                testcasename ='A variable "simdata" is not contained in the specified MAT-file.';
            end
            return;
        end
        testcasename = cell(size(simdata));
        for n=1:length(simdata)
            testcasename{n} = 'TestCase%03d';
        end
    otherwise
        simdata = '';
end

Contact us at files@mathworks.com