- https://www.mathworks.com/help/simulink/slref/fromworkspace.html
- https://www.mathworks.com/help/simulink/ug/load-data-using-the-from-workspace-block.html
using vector as an input data for stateflow chart
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello,
I have two arrays called time and velocity. Both are 4001x1 'double'. I would like to use them as an input data for stateflow chart to perform transitions between states depending on the current value from both arrays. After creating conditions for transitions between states, stateflow chart has now two inputs for input data (obviously). What is the way to use this arrays as an input data? 'From workspace' does not work. Following error is returned:
" Invalid matrix variable specified as workspace input in 'model/From Workspace'. The matrix data must be a real, double, have two dimensions, and at least two columns. The first column must contain time values and the remaining columns the data values. Matrix values cannot be Inf or NaN. "
My stateflow scheme looks like this:
Thank you in advance.
0 commentaires
Réponses (1)
Shanmukha Voggu
le 11 Mar 2022
Hi Kacper,
I understood you got the following error, when you are trying to read a matrix from the Base Workspace using 'From Workspace' block.
" Invalid matrix variable specified as workspace input in 'model/From Workspace'. The matrix data must be a real, double, have two dimensions, and at least two columns. The first column must contain time values and the remaining columns the data values. Matrix values cannot be Inf or NaN. "
As the error states, a 'From Workspace' block is intended to be used for time-varying signals and it must require matrix with at least two columns So, we cannot use matrix with only one column. Refer to below links to know more about 'From Workspace' block.
To resolve the issue in this case, a 'Constant' block should be used instead:
Hope this helps!
0 commentaires
Voir également
Catégories
En savoir plus sur Simulink Functions dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!