HOW TO ADD AUTOMATICALLY LOGS IN SIMULINK FROM A M FILE

[Total: 1    Average: 5/5]

A wire in simulink can be added to the log file just selecting it, right click and check “log out” in the properties. However, do it for all wires becomes a very slow operation.
The logs are often a problem if the Simulink project needs after to be compiled. logs are not supported during compilation so all of then must be removed.
The follow code provides a way to add and remove all logs scopes connected to wires just executing a Matlab function. The locations of the wires where the log has to be added are defined with a file. Each line of this file provide the name of the wire and the block where this is wire is located.

addremoveall_logs.m
 
config.txt

ConfigFile is a txt file organized as follows: