How to send data to a block continuously, like through clock block in simulink.
이전 댓글 표시
I am working on traffic simulation in Simulink. trying to show movement using coordinate system i am trying to makeup. I am facing following problem in that.
For now just consider x axis
For translation of car on x axis tried using FOR loop in embedded MATLAB function but it doesn`t give values of intermediate iterations.
When For Subsytem is used it gives out array on N size if N iterations are done.
But the desired Output should be scalar so as to feed it to VRsignal Expander(consider set to 1)
now How can i send values from that N sized array one by one by using another for loop ? n get the same problem again
well i think i m applying wrong Logic to this problem
If there is totally different and simpler way out to solve the problem of sending data continuously. i`ll appreciate the help.
댓글 수: 2
Paulo Silva
2011년 1월 29일
I posted an answer but wasn't working properly, I will try to find a way
Paulo Silva
2011년 1월 29일
Just tested a new way, see answer below, it's working here.
채택된 답변
추가 답변 (2개)
Kaustubha Govind
2011년 1월 31일
2 개 추천
The 'From Workspace' block is specifically designed to allow you to do this sort of thing. (If you have your data in a .mat file, you can use the 'From File' block).
Note that, Simulink needs you to provide time-stamps with your data, so it can determine what data-sample to use at the current time-step.
댓글 수: 2
Piyush
2011년 1월 31일
Kaustubha Govind
2011년 2월 1일
In that case, you may find it useful to use the Selector (http://www.mathworks.com/help/toolbox/simulink/slref/selector.html) block in "Index vector (port)" mode, with the "index vector" input as a scalar value sweeping from 1 to N. The Counter Limited (http://www.mathworks.com/help/toolbox/simulink/slref/counterlimited.html) block can be used to generate that kind of sweep.
Erçin
2012년 1월 6일
0 개 추천
Is there any opposite way send data to M-File with Simulink?
댓글 수: 1
Walter Roberson
2012년 1월 6일
'To Workspace' block. http://www.mathworks.com/help/toolbox/simulink/slref/toworkspace.html
카테고리
도움말 센터 및 File Exchange에서 General Applications에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!