Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
Hi!I have been trying a lot and I could not get the solution.Could someone please help me?
조회 수: 2 (최근 30일)
이전 댓글 표시
I have the outputs in work space which is an array I need to take simulink as input to the other block?Can anyone tell me the procedure how to do it?
댓글 수: 0
답변 (2개)
Walter Roberson
2018년 6월 25일
You can use To Workspace, and From Workspace. However, the contents are not written to the workspace until the simulation is paused or stopped.
댓글 수: 5
Walter Roberson
2018년 6월 25일
You would need to put an extra 0 at the beginning of X1 in order to indicate time 0 . Then you would use a From Workspace block to import it as a signal that was a vector of length 501. You would configure the "Form output after final data value by" property as holding the last value. The result would be that at time 0, it would import the vector of length 501, and pass the entire vector around as a signal (all of it existing at the same time), and with the property of holding the last value turned on, the signal would continue to be that vector as long as your simulation ran.
You would take this approach if you wanted to create the item as a signal. There are cases where you would want to instead use the data as a property of a block.
If the intention is that the first time the value was read it was 0, the second time it was 0.1, the third time 0.2, and so on, then you might have forgotten that in Simulink all actions have to have a time associated with them. Simulink will solve forwards and backwards in time as needed to achieve the required precision. There is no "next value in the sequence" in Simulink. There might be a fixed time step and an intention that the values happen in consecutive time steps: if so then it is still a time that needs to be associated with the data.
Ankita Bansal
2018년 6월 25일
편집: Ankita Bansal
2018년 6월 25일
Hi, let's say you want to add X1 to a sine wave in simulink. For this you have to give X1 as one input to the adder block which can be done by writing evalin('base','X1') in the "Data" parameter of "From Workspace" block.
댓글 수: 2
Walter Roberson
2018년 6월 25일
Or in this case you should be able to write just X1 in the Data parameter, which would allow it to search the hierarchy of data locations.
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!