How to assign struct to an empty cell
Afficher commentaires plus anciens
I am creating a blockTable but I'm stuck at where I try to put all my struct to an empty cell (blockCell)
function blockTable = createBlockTable(modelName)
load_system(modelName);
getBlock = find_system(modelName, 'FindAll', 'on', 'FollowLinks', 'on', 'LookUnderMasks', 'all', 'Type', 'Block');
blockCell = cell(1, length(getBlock));
for n = 1:length(getBlock)
structTable = struct('Handle', get(getBlock(n), 'Handle'), 'Name', get(getBlock(n), 'Name') );
end
end
I am wonder is it possible to use 'assignin' syntax to do this job, is there any way to solve this problem
1 commentaire
Walter Roberson
le 1 Déc 2020
for n = 1:length(getBlock)
structTable{n} = struct('Handle', get(getBlock(n), 'Handle'), 'Name', get(getBlock(n), 'Name') );
end
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Creating, Deleting, and Querying Graphics Objects dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!