Simulink
Matlab

Get the parameters of Simulink block

Simulink is a powerful simulating and programming tool. In many applications, we need to write scripts to automate specific tasks. At this time, we often need to obtain or modify the parameter values of the block diagram in command line. get() and get_param() Simulink provides get and get_param functions to Read more…

Simulink
Matlab

Plot bold line for Simulink block mask

Recently I discovered an undocumented feature of Simulink, i.e., plot bold line in block mask’s icon drawing commands. Limitations of the plot in icon drawing commands The plot function in the mask is a reduced plotting function. If we specify the linewidth parameter to it, an error will be prompted: Read more…

Matlab
Matlab

Matlab filter2 的用法

Y=filter2(h,x,’shape’) h为滤波器,x为要滤波的数据,将h放在x上移动进行模板滤波。shape可取 full, same, valid (不写默认是same)。本篇文章采用滑动平均fspecial(‘average’)创建一个均值滤波器,举例说明filter2的用法。