Why can't i use "from file" block in simulink
2 次查看(过去 30 天)
显示 更早的评论
i have a .mat file that i want to use in simulink using "from file" block
i put a "from file" and "scope" blocks into simulink and then connect them with each other.
i configured sample time in from file block as 1 that is equal to same sample time in .mat file and used fixed step ode3 solver with auto fixed-step size.
when i run, matlab gives no error, but i see this http://s7.postimage.org/y8ue6cmwr/matlab.png when i open scope
0 个评论
回答(2 个)
Azzi Abdelmalek
2012-11-30
编辑:Azzi Abdelmalek
2012-11-30
The problem is how you saved your data. Example
t=0:0.1:10; % vector time
y=sin(t) % t and y are line vectors
ty=[t;y] % ty should be a matrix with 2 rows
save filename ty
Now you can use your file in your simulink model. I think that you saved ty with two columns instead of 2 rows,
1 个评论
satish kumar
2020-8-11
Hello, i tried to load the data: t=[45, 67,8.9,6.7,5.5,3.2,5.6,7.9] into simulink using " from file " block in simulink. t is saved as .mat file. t is generated from matlab code. I am facing problem in loading all the points in simulink. the first data point in t, i.e. t(1)=45 is not loaded in simulink. others have been successfully loaded. Please help how to load data in array form like this without missing first point. kindly help.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Simulink Functions 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!