Using Data Store Memory in Stateflow
10 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Saygin
le 15 Août 2015
Commenté : Saygin
le 18 Août 2015
Hi, I use 'data story memory' block with bus which has matrix(arrray) elements. When accessing array element of structure data in stateflow chart(Action Language: C) following error is occured. If action language is matlab, there is no error with same structure.
"Array dimensions mismatch for structure data member..."
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/148089/image.png)
I've attached sample model file about this problem.
0 commentaires
Réponse acceptée
Chaitali Gondhalekar
le 17 Août 2015
I understand that you are trying to write to a Data Store Memory using C action language.
In order to achieve this in "Chart(C)", you can index into the array as follows:
MyData.buffer[0][0] = 1;
C action language follows zero based indexing as opposed to MATLAB action language that follows one based indexing. You can refer to the link below for further information about how to modify the action language of a chart:
You can also refer to the following link that lists the differences between MATLAB and C as Stateflow action language syntax:
Hope this helps!
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Complex Logic 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!