Before the final end
, insert
scalar_value = arr(count,1);
and declare your function as
[arr, scalar_value] = fcn(signal,V,count)
This will get the value of interest (scalar_value) in the 4x1 vector arr
, without disrupting the arr
logic.