To set the individual signal 'DataLogging' property you will need to find the line in the model corresponding to the selected signal. Then the 'DataLogging' property in the 'Srcport' object of the line needs to be set. If the model in question is the current model, and the name of the signal is 'DesiredSignal', the following code will set the 'DataLogging' property to 'on':
Sig_handle = find_system(gcs, 'FindAll', 'on', 'type', 'line','Name','DesiredSignal');
Srcport_handle = get_param(Sig_handle,'SrcPortHandle');
set_param(Srcport_handle,'DataLogging','on');
Best Answer