Is it possible to use structure variable as an input parameter for Matlab function block in simulink?
조회 수: 22 (최근 30일)
이전 댓글 표시
I need to use a structure variable as an input in my matlab function block! I've done the instructions as said in documentation but my model doesn't run. I think structure arrays aren't supported in matlab function block, are they?
댓글 수: 0
채택된 답변
TAB
2012년 12월 18일
편집: TAB
2012년 12월 18일
You can create a non-virtual bus signal in simulink and pass this to Matlab function block. Inside matlab function block, bus and its elements can be used in the form of structure.
Similarly you can create a structure in Matlab function block and output it as bus signal from the block.
See
Can you describe your implementation (post code & attach image). It is hard to say why it is not working without seeing the implementation.
[Edited 1] Type
>> emldemo_bus_struct
in your command window. This will open an example model of bus. You can proceed with this example.
Anyway, which matlab/simulink version are you using ?
댓글 수: 6
TAB
2012년 12월 18일
I will, whether structure parameters are directly supported in Matlab function block or not.
You can not change the parameter value (from any workspace) in the model. They are constant for the model.
추가 답변 (1개)
참고 항목
카테고리
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!