Unrecognized method, property, or field 'elements' for class 'Simulink.Bus'.
Show older comments
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
Accepted Answer
More Answers (0)
Categories
Find more on Composite Interfaces in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!