how to get respective blockpaths in 2 versions of a complex simulink model programmatically

i am trying to identify the blockpaths n model 2 which is respective /corresponding to the blockpaths in model 1 so that i can compare its block parameter values. But i am not getting the respective blockpaths. Any idea on this?

 Akzeptierte Antwort

4 Kommentare

But if a respective block is present in new version of the model with a different blockname , then how can we identify the respective block and compare its parameters?
To compare, use visdiff().
You need to clarify what is given. If it is comparing two versions of a Simulink model, usually many things (model name, model hierarchy and block names) are the same but the folders where the files are stored are different. Of course, there will be difference in the model like parameter difference, more or less blocks etc. The "same block" in two versions of a model with different block names could be regarded as a "Name" change, or regarded as two diffirent blocks, in that case, one block is regarded as deleted, one block is regarded as added.
So is there any way to compare those blocks with different blocknames without using visdiff? I can now compare parameter differences between those blocks with same blocknames. but i am stuck with blocks that has different blocknames
If you know the exact block names (although they are different in two versions of the same model), then you can get_param() directly and compare them. I guess your cituation is this. You know your target block, their names are different in two versions of a model but you don't know the "exact" block name. You want to get their block path or block handle to compare parameter differences. In that case, you have to use find_system() to find the block first. Hopefuly, you can use some common properties (like BlockType, Parent or some unique tags) to find each block "uniquely" in each version of the model and then compare them.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Produkte

Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by