| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Simulink |
| Contents | Index |
| Learn more about Simulink |
sldiscmdl('model_name',sample_time)
sldiscmdl('model_name',sample_time,method)
sldiscmdl('model_name',sample_time,options)
sldiscmdl('model_name',sample_time,method,freq)
sldiscmdl('model_name',sample_time,method,options)
sldiscmdl('model_name',sample_time,method,freq,options)
[old_blks,new_blks]
= sldiscmdl('model_name',sample_time,method,freq,options)
sldiscmdl('model_name',sample_time) discretizes the model named 'model_name' using the specified sample_time. The model does not need to be open, and the units for sample_time are simulation seconds.
sldiscmdl('model_name',sample_time,method) discretizes the model using sample_time and the transform method specified by method.
sldiscmdl('model_name',sample_time,options) discretizes the model using sample_time and criteria specified by the options cell array. This array consists of four elements: {target, replace_with, put_into, prompt}.
sldiscmdl('model_name',sample_time,method,freq) discretizes the model using sample_time, method, and the critical frequency specified by freq. The units for freq are Hz. When you specify freq, method must be 'prewarp'.
sldiscmdl('model_name',sample_time,method,options) discretizes the model using sample_time, method, and options.
sldiscmdl('model_name',sample_time,method,freq,options) discretizes the model using sample_time, method, freq, and options. When you specify freq, method must be 'prewarp'.
[old_blks,new_blks] = sldiscmdl('model_name',sample_time,method,freq,options) discretizes the model using sample_time, method, freq, and options. When you specify freq, method must be 'prewarp'. The function also returns two cell arrays that contain full path names of the original, continuous blocks and the new, discretized blocks.
model_name |
Name of the model to discretize. | ||||||||||||||||||||||||||
sample_time |
Sample-time specification for the model:
| ||||||||||||||||||||||||||
method |
Method of converting blocks from continuous to discrete mode:
| ||||||||||||||||||||||||||
freq |
Critical frequency in Hz. This input applies only when the method input is 'prewarp'. | ||||||||||||||||||||||||||
options |
Cell array {target, replace_with, put_into, prompt}, where each element can take the following values:
|
Discretize all continuous blocks in the sldemo_f14 model using a 1-second sample time:
sldiscmdl('sldemo_f14',1);
Discretize the Aircraft Dynamics Model subsystem in the sldemo_f14 model using a 1-second sample time, a 0.1-second offset, and a first-order hold transform method:
sldiscmdl('sldemo_f14',[1 0.1],'foh',...
{'sldemo_f14/Aircraft Dynamics Model',...
'parammask','copy','on'});
Discretize the Aircraft Dynamics Model subsystem in the sldemo_f14 model and retrieve the full path name of the second discretized block:
[old_blks,new_blks] = sldiscmdl('sldemo_f14',[1 0.1],...
'foh',{'sldemo_f14/Aircraft Dynamics Model','parammask',...
'copy','on'});
% Get full path name of the second discretized block
new_blks{2}
![]() | sldiagnostics | slIsFileChangedOnDisk | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |