When to use “to workspace” block vs “outport” block

조회 수: 2 (최근 30일)
Rostislav Teryaev
Rostislav Teryaev 2018년 4월 13일
답변: Birdman 2018년 4월 14일
I can use both blocks for getting output from simulink to matlab, but if there are two of them there should be difference in the way they are used but I can not figure it out.

답변 (1개)

Birdman
Birdman 2018년 4월 14일
Actually, there is no certain answer for that and also, they are not intended to be used for just logging the simulation data. Let's mention their properties separately to actually see what is going on:
Firstly, outport blocks are a part of any kind of Subsystems and they help us to organize and identify the outputs within a subsystem or a referenced model. Also, an outport block has several properties where you can specify its own sampling time, port dimensions and units. Also, in its Data types part, you can specify its data configuration as fixed point or floating point with several types. You can specify a special name for that outport to ensure that in code generation, it can be easily detected.
On the other hand, To Workspace block helps you to specify the Save format of the logged data to be specified separately as an Array, Structure or Timeseries. In either case, it enables you to plot or use the data at the end of the simulation with its changing properties due to its save format. Also, you can specify sampling time for To Workspace block but you can not change the output data type of a To Workspace block within its mask, or you can not specify any unit for it. It also does not provide any useful contribution to be used within a subsystem, since logging simulation data can also be done from Configuration Parameters section of Simulink.
There are more things to be mentioned but I think this will be enough for now.

카테고리

Help CenterFile Exchange에서 Sources에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by