How to log a block in simulink-model programmatically?

3 views (last 30 days)
Hi everyone,
is there any way to log a block in simulink-model programmatically
this is how i log signals on and off
selectObj = find_system(gcs,'findall','on','selected','on','Type','line','parent',gcs);
sourcePortArr = get(selectObj,'SrcPortHandle');
set_param(sourcePortArr,'DataLogging','off'); % or set_param(sourcePortArr,'DataLogging','on')
is there any way like this ?
thank you in advance

Accepted Answer

Abhisek Pradhan
Abhisek Pradhan on 19 Sep 2019
Simulink doesn’t support block logging. Rather one can log the signals coming out of the blocks for all required purposes.

More Answers (0)


Find more on Prepare Model Inputs and Outputs 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!