How can I programmatically delete a group (test case) from a signalbuilder?

I wish to delete a single group from a signalbuilder, via MATLAB scripting.
I tried via sigbuilder function with 'dataSetDelete' method, but unsuccessfully.
I am using MATLAB 2016b.

 채택된 답변

doc signalbuilder
Create Signal Builder Block and Delete Group
Create a Signal Builder block with two signal groups and delete one of the groups.
block = signalbuilder([], 'create', [0 2], {[0 1],[1 0]});
The Signal Builder block has two groups, each of which contains a signal. :
To delete the second group, also delete its signal.
signalbuilder(block, 'set', 1, 2, [], [])

댓글 수: 4

This is exactly what I was doing.
The error I am getting is this:
Error using signalbuilder (line 410)
You can only remove signals from all groups.
You cannot delete signals from only a subset of groups.
What I am trying to do is to delete only the group of signals with their respective data points, not the actual signals themselves. They should be common to all the groups in the signalbuilder.
It looks like your syntax is not right. Just try those two lines above in R2016b with a blank model. You will see a SignalBuider block is created with two groups (Group 1 and Group 2). "Group 2" is deleted after the second line.
I saw your point. I tested it, and it works if you have one signal per signalbuilder. When you have more than one signal, you get the error I pasted in the post above.
block = signalbuilder([], 'create', repmat({[0 2]},2,2), repmat({[0 1]},2,2));
signalbuilder(block, 'set', 1:2, 2,[],[])

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

추가 답변 (0개)

카테고리

제품

릴리스

R2016b

태그

질문:

2019년 7월 23일

댓글:

2019년 7월 24일

Community Treasure Hunt

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

Start Hunting!

Translated by