How can I force Simulink to use a set of data (time depended) as input?
6 次查看(过去 30 天)
显示 更早的评论
Hi All,
I have a Simulink file which simulate the dynamics of a car. In particular, the model input are the steering wheel angle and the speed. The output is the lateral acceleration developed by the car. The sampling time of the model is 0.005 sec.
I have the input data logged every 0.005sec from the data acquisition system of a car in Excel format. The file contain 3 columns: time, steering wheel angle and speed
How can I force Simulink to process the file using time, steering wheel angle and speed from the Excel file?
Any help is more than appreciated
Thanks for your time
G
0 个评论
采纳的回答
Azzi Abdelmalek
2013-1-1
编辑:Azzi Abdelmalek
2013-1-1
I don't think you can do it with xlsread function in 0.005 sec, plus the time of simulation which depends on the complexity of your model. But If you want to simulate after all data are imported, use
data=xlsread('yourfile.xlsx');
t=data(:,1);
angle=data(:,2);
speed=data(:,3);
ta=[t';angle'];
ts=[t';speed'];
save file1 ta
save file2 ts
Then use in simulink the from file block with respective names file1 and file2
0 个评论
更多回答(1 个)
Rick Rosson
2013-1-1
编辑:Rick Rosson
2013-1-1
Use the xlsread function to read the data into the MATLAB Workspace, then use the From Workspace block to bring the data into Simulink.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Sources 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!