MATLAB Answers

0

produce a cell array of cell arrays of element names

Asked by Anju Mohokar on 31 Oct 2019
Latest activity Commented on by Anju Mohokar on 12 Nov 2019
I want to create a cell from a cell arrays of simulink. elements present in matlab workspace. I have tried with below command in matlab 2019b
element_names = getElementNames{elements}; // whereas elements is the name of cell in workspace with all elements.
and getting below error:
error.JPG

  0 Comments

Sign in to comment.

1 Answer

Answer by YT
on 31 Oct 2019
 Accepted Answer

If getElementNames is a function, you should use round brackets instead of curly brackets:
element_names = getElementNames(elements);

  3 Comments

Tried using round brackets still getting below error due to type cell:
error.JPG
You should check the documentation, which states you should input a Simulink.SimulationData.Dataset object, not just a cell:
element_list = getElementNames(dataset) returns the names of all of the elements in the Simulink.SimulationData.Dataset object.

Sign in to comment.