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

for n = 1:length(getBlock)
structTable{n} = struct('Handle', get(getBlock(n), 'Handle'), 'Name', get(getBlock(n), 'Name') );
end

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

 채택된 답변

Khoi Le
Khoi Le 2020년 12월 1일

0 개 추천

for this question, I just solve it myselft by adding
blockCell{1, n} = structTable;
right after
structTable = struct('Handle', get(getBlock(n), 'Handle'), 'Name', get(getBlock(n), 'Name') );

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Simulink에 대해 자세히 알아보기

질문:

2020년 12월 1일

답변:

2020년 12월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by