MATLAB: Elements of the input after a sum block

feedbacksimulinksum

Hi, I have a Simulink model that contains a feedback. After the feedback, I should do some discrete convolution on the input. The problem is the following. My input is given by my time vector, and two columns that are my two input currents. The system (should) looks like this
But, I get the error "Invalid external input specified. The specified input has 2 element(s) for each sample while the sum of the port widths of all root level input port blocks in the model is 1". Even though I checked and after the sum block I have a signal that has the same dimension of the input (so, time and two colums for the currents). Also, above the arrow, there is a "2", so I see that also after the sum block I have 2 elements. Instead, if I do this
I do not get any errors. But this is not what I should do… I think that has something to do with the feedback and the very first sample time. But I am not sure how to solve this issue. If this is the issue. Any suggestion is appreciated. Best Maria

Best Answer

Do not supply workspace variables into a Simulink model by root level inport. Instead, usage of From Workspace blocks are more efficient and easier. I made some changes to your model where you had problems with dimension. The mat file variables are automatically loaded when you open the model. Now, rearrange the model if you need to and the simulation should run without any error. Let me know the results.