Convert algorithm code to simulink model

 Respuesta aceptada

Chandrasekhar
Chandrasekhar el 20 de Mzo. de 2014

0 votos

Suma, Please find the attached model. I hope this will help you

Más respuestas (3)

Viju
Viju el 19 de Mzo. de 2014

0 votos

You can incorporate existing MATLAB script in a Simulink model using MATLAB function blocks. For information on that, take a look at: http://www.mathworks.com/videos/incorporating-matlab-algorithms-into-a-simulink-model-69028.html

3 comentarios

Suma
Suma el 19 de Mzo. de 2014
Editada: Suma el 19 de Mzo. de 2014
Hi,
I have come to know about this function block, but I don't want to create function rather I have an algorithm of the following form-
%defination part a = b = c = %input part x = enter()
for i=1:N
part 1
execute for each k
part 2
execute for each k
.... ... ... end
%output part
display()
calculate()
So I want to create each part a separate sub-model block in a simulink, is this possible? and how to put the for loop?
Thanks
Viju
Viju el 20 de Mzo. de 2014
I don't understand the problem entirely (and perhaps your k is i). Can you elaborate on what exactly you are looking to do?
Chandrasekhar
Chandrasekhar el 20 de Mzo. de 2014
Suma, there is not method of converting an mscript to a simulink model. You need to develop the algorithm in simulink based on the mscript

Iniciar sesión para comentar.

Suma
Suma el 20 de Mzo. de 2014
Editada: Suma el 20 de Mzo. de 2014

0 votos

Hi,
I want to build a simulink sub-blocks:
1. a sub block that generates random vectors(2x2 column) for i=1:N
2. another sub-block that acts on each column vectors generated in step1
etc
Do I need to build function script for these? What about the loop?
So, I want to be sure whether function block is the right way and whether there are any alternative approaches.
thanks again

1 comentario

bouchra ayoubi
bouchra ayoubi el 3 de Mzo. de 2015
hello , Suma ... find you the answer ? because i have the same problem

Iniciar sesión para comentar.

Suma
Suma el 20 de Mzo. de 2014

0 votos

thanks, one more question though- is there any tutorial on the thing you have done?

Categorías

Más información sobre Modeling en Centro de ayuda y File Exchange.

Preguntada:

el 19 de Mzo. de 2014

Comentada:

el 3 de Mzo. de 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by