Naming of bus elements using a cell-array of names
1 回表示 (過去 30 日間)
古いコメントを表示
I want to access the vector output of an S-function as a bus. For this, I'm using a Demux to give labels to each element and then a BusCreator to create the bus. The question now is, how can I assign the channel names in the Demux outputs with commands using a list of names? Or is there a better way altogether?
There is a property of the Demux block called 'OutputSignalNames', which are the current names, but that is read-only.
0 件のコメント
回答 (2 件)
Shivam Chaturvedi
2016 年 3 月 1 日
編集済み: Shivam Chaturvedi
2016 年 3 月 1 日
Hi Thomas,
Instead of using OutputSignalNames, you can use the PortHandles parameter, and get the handles to the individual signals and assign the Name property to each of the signals individually.
here's an example:
% assuming you had the handle of the demux block in a variable called 'demuxhandle'
hPorts = get_param(demuxhandle, 'PortHandles');
outputPorts = hPorts{1}.Outport;
% assuming you had just 2 outports
signalnames = {'a', 'b'};
firstPort = outputPorts(1);
set_param(firstPort , 'Name', signalnames{1})
secondPort = outputPorts(1);
set_param(secondPort , 'Name', signalnames{2})
Hope this helps!
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Sources についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!