Unit format types from matlab functions to rtmaps components

I have been running into some issues when using the matlab to rtmaps tlc. The components that are created seem to have difficulty reading/outputting vectors and arrays. This was a simple example I ran to test functionality. I converted the following matlab code into rtmaps packages then ran the following diagram. As can be seen, even though the functions can be turned into the components, the output is not what is expected. interpretArray4 thinks that the first and second position of the input vector are the same when they are clearly different. Any help on why this is the case would be very helpful.

First matlab function:

function [outputArg1] = createRandStdInputvec(inputArg1)
%UNTITLED2 Summary of this function goes here
%   Detailed explanation goes here
arguments
    inputArg1 (1,1)
end
if inputArg1 == 1
    outputArg1 = rand(1,9);
else
    outputArg1 = zeros(1,9);
end
end

Second matlab function:

function [outputArg1,outputArg2] = interpretArray4(inputArg1)
%UNTITLED Summary of this function goes here
%   Detailed explanation goes here
arguments
    inputArg1 (1,180)
end
outputArg1 = inputArg1(1);
outputArg2 = inputArg1(2);
end

RTmaps diagram

Hello,
I can reproduce the problem using the rtmaps_function2pck.
We are investigating how to fix this currently. I’ll keep you in touch.

Thanks for the report.

Hello,

We faced a similar issue, and I thought I’d update it here.
It seems the issue is a limitation of the MATLAB function block in Simulink that doesn’t automatically take dimension specifications from the MATLAB code.
More details here: Simulink Coder: Why is my Matlab function input array not generated properly when the Inport dimension is -1 ? - MATLAB Answers - MATLAB Central

A quick workaround would be to manually create the Simulink model and setting the Inport dimension to the dimension expected by the function (and generating the RTMaps component using rtmaps_model2pck or the Simulink GUI) instead of using the rtmaps_function2pck() command.
In the future we may add the Inport dimensions as a parameter of rtmaps_function2pck.

Thanks for your patience,
Best regards,