function [mean,stdev] = stats(vals)%#codegen
%calculates the statistical mean
%and s.d for the values in vals
len = length(vals);mean = avg(vals,len);stdev = sqrt(sum(((vals-avg(vals,len)).^2))/len);coder.extrinsic('plot');plot(vals,'-+');function mean = avg(array,size)mean = sum(array)/size;
MATLAB: I am attempting to use the MATLAB Function block in the simulink model; however evrytime i run it, the following errors occur; “Please change your current directory to a writable directory preferably outside of MATLAB installation area.”
change directorymatlab functionsimulink
Best Answer