passing a cell array structure to matlab function
15 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(1 个)
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).
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Financial Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!