I have signal name which is stored in one variable and I want to make that signal as simulink object, could you please help me to create the object

2 次查看(过去 30 天)
B{1,1} = 'InportSignal' now I want to make the InportSIgnal as mpt.signal.
So I try like B{1,1} = mpt.signal, but it is not assigning this to InportSignal instead of that it is creating obejct to B{1,1}
that means it is replacing InportSignal.
Please help

采纳的回答

Fangjun Jiang
Fangjun Jiang 2019-10-9
编辑:Fangjun Jiang 2019-10-9
eval([B{1,1},'=mpt.Signal;']);
or
mptsignal=mpt.Signal;
assignin('base',B{1,1},mptsignal)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Physical Units 的更多信息

标签

产品


版本

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by