Is there an easy way to compare the contents of 2 subsystems in MatLab? I want to take one subsystem and check it against another to ensure the contents of both are the same. I didn't want to try to create a loop that'll take all the block from the subsystems and loop through them checking each parameter of each block to make sure all the logical operator are the same.
I don't know what you mean with "subsystem", but if you have two variables with any kind of data (no matter if it's a struct or a cell or a numerical array) and you want to check for equality, use isequal(var1,var2).
Subsystems in Simulink. I can get the blocks out of each subsystem and I can compare them to make sure the names are the same and they have the same amount of blocks, but one can have an AND gate while the other has an OR. So the only way for me to fully know if they're the same is to compare the block parameters of each subsystem and see what blocks they're connected too.
I didn't know if there was some "magical" function built into MatLab that not a lot of people know about that'll compare them for me.
I tried to use isequal, but it only works for the blocks in the subsystems, it doesn't compare the parameters. If I have to do it by hand, I'll have to use isequal on all the blocks parameters as well.
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
0 Comments
Sign in to comment.