Unrecognized method, property, or field 'elements' for class 'Simulink.Bus'.
18 ビュー (過去 30 日間)
古いコメントを表示
Peman
2025 年 12 月 16 日 18:14
コメント済み: Fangjun Jiang
2025 年 12 月 17 日 14:38
Hello,
I have a project initially designed in MATLAB R2011b and opened it in MATLAB R2025b and got the following error. Any idea how to fix this issue? It seems like the 'elements' method no longer exists (deprecation) on the 'Bus' object. Below is also the piece of code that is causing this issue.
Error: Unrecognized method, property, or field 'elements' for class 'Simulink.Bus'.
Code causing error above:
function busOut = funSetSamplingtimeBus(bus, samplingtime)
for index = 1:length(bus.elements),
bus.Elements(index).Sampletime = samplingtime;
end
busOut = bus;
end
Thanks,
PM
0 件のコメント
採用された回答
Fangjun Jiang
2025 年 12 月 16 日 18:35
編集済み: Fangjun Jiang
2025 年 12 月 16 日 18:47
It should be .Elements with the capital "E". It might be that in the older version, it was not enforced to match the case between MyBus.elements and MyBus.Elements.
2 件のコメント
Fangjun Jiang
2025 年 12 月 17 日 14:38
Yes. Now it definitely reminds me that matching case was not required before.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Composite Interfaces についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!