Create Array in Simulink
Mostrar comentarios más antiguos
Hello
I want to create an array in Simulink based on two constants. Like using "linspace(1,1,10)" in Matlab, but from two constant blocks of magnitude "1" and "10".
Thanks in Advance
Respuestas (1)
Azzi Abdelmalek
el 9 de Ag. de 2015
0 votos
2 comentarios
David C
el 9 de Ag. de 2015
Azzi Abdelmalek
el 10 de Ag. de 2015
function y = fcn(u)
%#codegen
coder.extrinsic('linspace')
y = coder.nullcopy(zeros(1,numel(u)));
y =linspace(1,u, u)
Don't forget to declare the output y (type edit data in the editor of your function) as variable size.
Categorías
Más información sobre Simulink Functions en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!