erloroloco
Mechanical
- Jan 16, 2007
- 2
The idea of the calculation is to make calculations on an input array (called p). Afterwards, a calculation of the standard deviation within a range is introduced and should be written out into the workspace. At the moment, the following statement does what I want, but only in the matlab environment.
function prms = RMS(p)
i=3000;
px=p-mean(p);
%calculation of the standard deviation within a range
for n=0:length(px)-1
py{n+1,:}=std(px(n+1:n+i,);
end;
%convert cell array into a numerical array
for k=1:length(py)
for m=1:length(py{1})
NUM(m,k)=py{k}(m);
end;
end;
NUMOut=NUM';
Trying to include this simple functions in Simulink as Embedded ones, the following
error is reported:
"Unsupported: cell Arrays"
The calculation bases on a long array. Over this array the calulation
is done in 3000 array element intervals.
The question is: is there a way to convert the cell array format into another one supported by the "Embedded Function"? Or is simply another way of implementing this idea into Simulink?
Thank you very much in advance
function prms = RMS(p)
i=3000;
px=p-mean(p);
%calculation of the standard deviation within a range
for n=0:length(px)-1
py{n+1,:}=std(px(n+1:n+i,);
end;
%convert cell array into a numerical array
for k=1:length(py)
for m=1:length(py{1})
NUM(m,k)=py{k}(m);
end;
end;
NUMOut=NUM';
Trying to include this simple functions in Simulink as Embedded ones, the following
error is reported:
"Unsupported: cell Arrays"
The calculation bases on a long array. Over this array the calulation
is done in 3000 array element intervals.
The question is: is there a way to convert the cell array format into another one supported by the "Embedded Function"? Or is simply another way of implementing this idea into Simulink?
Thank you very much in advance