How to solve "Dot indexing is not supported for variables of this type...."?

6 ビュー (過去 30 日間)
Tommy
Tommy 2025 年 3 月 26 日
編集済み: Tommy 2025 年 3 月 27 日
Hi,
I wrote a small script to made 4 modules and connection betweeen (pic attached).
I got error message while I tried to connect phisical POS and got "Dot indexing not support for variableof this type".
Can someone help tounderstand whats the problem?
file Matlab script:
open_system('String_arc')
mdl = 'String_arc';
Cube_model = find_system(mdl,'FindAll','on','Name','String_arc');
%%% add basic Module:
for v=1:4 %% loop for 4 Modules
nl=num2str(v);
Add_module(v) = add_block('Mod_26_cells/Module_MC 1', [mdl,'/Module_MC ',nl]);
posc = get(Add_module(v),'Position');
set(Add_module(v),'Position',posc + [100 120*(v-1)-45 100 120*(v-1)-45])
PH_Add_module{v}=get(Add_module(v),'PortHandles');
%%% connect minus to plus ports:
if v>1
add_line(mdl,PH_Add_module{v-1}.LConn(2),PH_Add_module{v}.LConn(1),'Autorouting','on');
end
end
% connect the POS port to first CELL (Cell 1):
Plus_str = find_system(mdl,'LookUnderMasks','All','FindAll','on','Name','POS');
PH_plus2str=get(Plus_str,'PortHandles');
add_line(mdl,Plus_str.RConn,PH_Add_module{1}.LConn(1), 'Autorouting','on');
  4 件のコメント
Walter Roberson
Walter Roberson 2025 年 3 月 27 日
What happens if
Plus_str = find_system(mdl,'LookUnderMasks','All','FindAll','on','Name','POS');
returns empty because no system named POS was found?
Tommy
Tommy 2025 年 3 月 27 日
Hi,
But POS is PMC_port stick on canvas...a basic slx flie shown on pic above.....

サインインしてコメントする。

回答 (1 件)

Walter Roberson
Walter Roberson 2025 年 3 月 27 日
移動済み: Walter Roberson 2025 年 3 月 27 日
What happens if the command returns empty because no matching lines, ports, or annotations were found?
Option to search for a specific type of model element, specified as one of these:
  • 'block'
  • 'line'
  • 'port'
  • 'annotation'
To find lines, ports, or annotations in the model, you must first specify the value of FindAll as 'on', and then the value of Type.
You did not specify 'type' in your search, so no searching by port would be done.
  20 件のコメント
Tommy
Tommy 2025 年 3 月 27 日
Tommy
Tommy 2025 年 3 月 27 日
編集済み: Tommy 2025 年 3 月 27 日
connection between POS and NEG PMC_port ....(mark as 1 and 2)

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeProgrammatic Model Editing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by