×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Are you an
Engineering professional?
Join Eng-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

#### Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

# How to include cell arrays in a Matlab Embedded Function for simulink

## How to include cell arrays in a Matlab Embedded Function for simulink

(OP)
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

#### Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

#### Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Close Box

# Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!