Using a matrix in Matlab Functions

1 visualización (últimos 30 días)
Mohammad Hussein Yoosefian Nooshabadi
Hi I have a matrix in my workspace and I want to use it in simulink. I used the From Workspace block but I faced this error when I ran my model, that mean it used the only last element of my matrix. Does any body know how to fix it?
Error:Attempted to access index 2 of an array with smaller dimension sizes.

Respuesta aceptada

Jan
Jan el 26 de Mzo. de 2017
The error message means, that the variable is eitehr a scalar in opposite to your assumptions, or that it is e.g. a [N x 1] vector and you try to access [1 x 2].
  2 comentarios
Mohammad Hussein Yoosefian Nooshabadi
No, it is a 1 x N matrix.( it includes ASCII codes of a text in a row)
Mohammad Hussein Yoosefian Nooshabadi
how should I Use this matrix in a function? should I use a Const block or a From Workspace block?

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Programmatic Model Editing en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by