simulink from file source block
Show older comments
I am trying to load some data that is generated in matlab into a source "from file" block in simulink. I use the following statement in my matlab script to save the data:
save awng.mat Y_awgn_scale -v7.3;
I tried a few different flavours with saving the time step etc and none of it works. I can load the data into the workspace which shows the data in awng.mat to be a one dimensional array of type double:
However, If I specify the file name in a "from File" source block, upon trying to load, I get an error message:
Simulink does not support loading the input data in file 'C:\Users\marka\Documents\MATLAB\awng.mat'. Simulink can only load two-dimensional arrays or timeseries objects. The array must consist of one-dimensional, double, noncomplex samples. To load data having a different type, complexity, or dimension, use a timeseries object. For either an array or a timeseries object, at least one sample point is necessary.
This error message is confusing. Does the array needs to be two dimensional or one? I tried adding a variable that had the time stamp and it did not do anything. I have left all the settings in the "fromFile" simulink block as default. I am using 2012a release.
Can you post a sample file that is read in or specify what save command needs to be used to save a simple array of data of type double I need to use so that I can load it into "from file" source?
Thanks,
Accepted Answer
More Answers (0)
Categories
Find more on Sources in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!