필터 지우기
필터 지우기

How do I get the name of the signal if it is not in a structured array?

조회 수: 1 (최근 30일)
Kyle
Kyle 2013년 8월 19일
I am attempting to set the parameter of a bus selector to a specific signal in a masked sub system using
load_system('simulink');
set_param(gcb, 'MaskSelfModifiable', 'on');
ph = get_param([gcb,'/In1'],'PortHandles');
sh = get_param(ph.Outport, 'SignalHierarchy');
sc = sh.Children(sns,1).SignalName;
set_param([gcb,'/Bus'],'OutputSignals',sc);
sns is a user input to the masked block
The code above alters the contents of the masked subsytem by when I go to simulate the model I recieve 2 errors
Initialization commands cannot be evaluated.
and
Attempt to reference field of non-structure array.
How do I get the name of the signal if it is not in a structured array?
  댓글 수: 1
Kaustubha Govind
Kaustubha Govind 2013년 8월 19일
What do you get in sh when you run the same commands in the MATLAB prompt after selecting the subsystem?

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Configure and View Diagnostics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by