【Matlab 控制】利用 Matlab Function 绘制分段函数
作者:互联网
利用 Switch block
利用 Matlab Function block
function [mean, stdev] = fcn(vals)
% #codegen
% calculates a statistical mean and a standard
% deviation for the values in vals
len = length(vals);
mean = avg(vals, len);
stdev = mean+1;
coder.extrinsic('plot');
plot(vals, '-+');
function mean = avg(array, size)
mean = sum(array)/size;
标签:Function,function,分段,Matlab,vals,array,mean 来源: https://blog.csdn.net/weixin_36815313/article/details/111054291