I am trying to create a function that can create a block table that contains their Handle, FullName, BlockType, Parent by using struct. However, each time I get to enter a model name, it said Error using struct Field names must be non-empty character vectors or a string scalars. Error in createBlockTable (line 10) tableStruct […]
Categories
struggle when creating a block table with Matlab
- Post author By Full Stack
- Post date December 1, 2020
- No Comments on struggle when creating a block table with Matlab
- Tags 'Block'); blockCell = cell(1, 'FollowLinks', 'LookUnderMasks', 'Name') ); end end, 'Name'); end end blockTable = assign(tableStruct, 'Name'); Here is my code function blockTable = createBlockTable(modelName) load_system(modelName); getBlock = find_system(modelNam, 'on', "All"]], [Type], 1) tableStruct = struct(get(i), 1). I think i just mess up with something in that line. BUt I do not know how to solve this problem. Please help, blockCell); end I am really confuse at i = getBLock(n, blockType, each time I get to enter a model name, findAll, fullName, get(getBlock(n), handle, I am trying to create a function that can create a block table that contains their Handle, it said Error using struct Field names must be non-empty character vectors or a string scalars. Error in createBlockTable (line 10), length(getBlock)); for n = 1:length(getBlock) for i = getBlock(n, length(getBlock)); for n = 1:length(getBlock) structTable = struct('Handle', Name, Parent by using struct. However, thanks UPDATE #1 After a day I manage to solve it in a way but I do not know how to put all the struct in for loop to an empty cell functio