Main Content

validateFileNameImpl

Class: Simulink.io.FileType
Namespace: Simulink.io

Validate contents of custom MAT-file

Since R2020a

Syntax

validateFileNameImpl(reader,fileName)

Description

validateFileNameImpl(reader,fileName) validates the format of the signals in the custom MAT-file fileName with the associated Simulink.io.FileType reader.

Input Arguments

expand all

Reader, specified as a Simulink.io.FileType object.

File name of a MAT-file that contains custom signals, specified as a character array.

Data Types: char

Examples

expand all

Subclass FileType class and implement the validateFileNameImpl method.

classdef MySignalMatFile < Simulink.io.FileType

Implement static method validateFileNameImpl.

function validateFileNameImpl(aFile,filename) %#ok<INUSL>
%validateFileNameImpl

[~, ~, fileExt] = fileparts( filename );
isSupported = strcmpi(fileExt,'.mat');

if ~isSupported
    error('This file format is not supported by application.');
end

end

Version History

Introduced in R2020a