I'm having a problem with inherited signal/vector sizes in my simulink model. I've got input signals that respresent vectors of the size 50 and I need to shift the values to the left /right while setting the last/first corresponding values to zero depending on where the values were shifted. E.g.: [1 2 3 4 5] -> [0 1 2 3 4] I use the following matlab function for shifting right (left shifting is analogous):
function y = shiftVectorRight(u,indx,dim)
Now I got the following error, when Updating/Running the model for one of these functions in the model:
Inferred size ('') for data 'y' does not match specified size ('scalar').
The data type and size of the signals of the MATLAB function is set to inherited and all input signals to the system have a consistent length and I got several of these blocks in the system (but just one triggers this error). As you can see. On the first function Simulink can't inherit the size, on the second it can. (Other Shift Vector Right Functions do work in the model. )
Why cant simulink inherit the correct size? Is there a way to fix this without setting the output signal size of the function?
Thanks in advance Greetings