Simulink "To Workspace" is outputing 3D array, why?
52 views (last 30 days)
I am passing data to/from Simulink from an .m file. I have most of it understood but one part. One of the signals I pass back from Simulink is being stored in a 3D array but I don't know why. It is a simple time series (i.e. a single column of data). Other (seemingly) identical data is formatted fine.
Here is my example: I have an initial sine wave that I add "13" to. I want to return the initial sine wave and the resulting sine wave, both to my .m file for plotting. The initial sine wave array is of size (51,1). The resulting sine wave array is of size (1,1,51). Why did this happen this way?
[How do I upload a .mld file here?]
function  = IO_to_simulink_test_function ()
input_to_simulink = 13; % this is a constant
mySimOptions = simset('SrcWorkspace','current'); %setup current workspace
fprintf('The size of initial_sine_wave is:\n')
fprintf('The size of resulting_sine_wave is:\n')
title('Initial Sine Wave')
title('Resulting Sine Wave')
More Answers (2)
Albert Yam on 16 Jul 2012