function [outData] = commMIMOChannelTransform(inData)
%COMMMIMOCHANNNELTRANSFORM Transform function for MIMO Channel block. 

% Copyright 2017-2018 The MathWorks, Inc.

InstanceData = inData.InstanceData;
outData.NewInstanceData = InstanceData;

[~, corrSpecIdx] = find(strcmp('SpatialCorrelationSpecification', {InstanceData.Name}));
if isempty(corrSpecIdx) % A pre-17b model
    [~, corrIdx] = find(strcmp('SpatialCorrelation', {InstanceData.Name}));
    if ~isempty(corrIdx)
        outData.NewInstanceData(corrIdx).Name = ...
            'SpatialCorrelationSpecification';
        if strcmp(InstanceData(corrIdx).Value, 'on')
            outData.NewInstanceData(corrIdx).Value = 'Separate Tx Rx';
        else
            outData.NewInstanceData(corrIdx).Value = 'None';
        end
    end
end

[~, inheritRsIdx] = find(strcmp('InheritSampleRate', {InstanceData.Name}));
if isempty(inheritRsIdx) % A pre-18a model
    outData.NewInstanceData(end+1).Name  = 'InheritSampleRate';
    outData.NewInstanceData(end).Value = 'off';
end

[~, chanInterpMethodIdx] = find(strcmp('ChannelInterpolationMethod', {InstanceData.Name}));
if ~isempty(chanInterpMethodIdx) % A 18a, 18b or 19a model
    outData.NewInstanceData(chanInterpMethodIdx) = [];
end

outData.NewBlockPath = inData.ForwardingTableEntry.('__slOldName__');

% [EOF]
