Hey Alice,
The error message you're encountering indicates that the input data for the "From Workspace" block in Simulink needs to be formatted such that it is a matrix where the first column contains time values and the subsequent columns contain the corresponding data values.
You already have the required data, all you need is to transpose 't' and 'ecg' and combine them into a single matrix.
% Combine time and data into a single matrix
simulink_input = [t' ecg']; % transpose to ensure columns
Now, you can use 'simulink_input' as the input for the "From Workspace" block in Simulink.
Hope this helps!