passing a cell array structure to matlab function

조회 수: 15 (최근 30일)
Preethi
Preethi 2013년 12월 9일
답변: Walter Roberson 2013년 12월 9일
hi,
I am using matlab function block in Simulink. I have to pass a structure as input to the function. I have changed the type to parameter in model explorer. While executing i received the error " Error using sf MATLAB class 'cell' found at 'ctx.S' is unsupported."
I tried converting the cell array to character array and then used the character array(instead of entire structure) as input to the function. In this case i got error " Error using sf Expression 's' for initial value of data 's' (#51) must evaluate to a numeric or logical"
ctx is the structure i am using.
i assigned the structure fields as s =ctx.S
ctx.S is a cell array of hexadecimal values stored as strings.
I want to have the data as hexadecimal inside the function.How do i pass the values in ctx.S to the matlab function used in Simulink?
Thanking you in advance.

답변 (1개)

Walter Roberson
Walter Roberson 2013년 12월 9일
Simulink does not support cell arrays or strings as data types for signals. Anything you want to pass to another block as a signal must be in numeric form (or logical).

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by