function warnmsg = saveDataToFile(sldvData, filename, createableSimData)  %#ok<INUSL>
    warnmsg = '';    
    if nargin<3
        createableSimData = true;
    end
    
    if isempty(filename)
        warnmsg = getString(message('Sldv:shared:DataUtils:FilenameNotEmpty'));
    end
        
    if createableSimData
        try
            save(filename, 'sldvData');
        catch Mex %#ok<NASGU>
            warnmsg = getString(message('Sldv:shared:DataUtils:CannotWriteToFile',filename));            
        end    
    else
        warnmsg =  getString(message('Sldv:shared:DataUtils:FixedPointDesignerRequired'));
    end
end
