Can i able to access value from Data store memory in Embedded Matlab Function

I am trying to access value of data store memory in matlab embedded function. But when I update my model I am getting the following error
*Embedded MATLAB Runtime Error: Error evaluating Embedded MATLAB parameter data 'Flag1' (#40) in its parent workspace.*
Can anyone please tell me why I am getting this error or any solution for this.
Thanks in advance.

 採用された回答

TAB
TAB 2012 年 9 月 7 日
編集済み: TAB 2012 年 9 月 7 日

1 投票

In version R2007b, using global variable in Matlab function (or Embedded matlab function) is not supported.
You can simply read the value of Data store memory using Data store Read block and pass this to Matlab function block as input, as shown here.

その他の回答 (1 件)

Kaustubha Govind
Kaustubha Govind 2012 年 9 月 6 日

0 投票

Have you configured the block according to the documentation? Perhaps the Scope for 'Flag' has not been set to 'Data Store Memory' on the Ports and Data Manager?

5 件のコメント

niharika
niharika 2012 年 9 月 7 日
HI Thanks for your reply. I have configured according to the documentatoin only. I had set '*Parameter*' as the Scope on Ports and Data Manager as I could not find any option as 'Data Store Memory' . I am using matlab of version 2007b.
TAB
TAB 2012 年 9 月 7 日
Which version of matlab you are using ? Global data in Matlab function block is somewhat newer feature not available in old versions.
niharika
niharika 2012 年 9 月 7 日
I am using 2007b version of matlab. In this version, global is not supported. Can you please let me know if there is any other solution available to solve this issue.. Can anyone help me in this, its urgent require for me.
Kaustubha Govind
Kaustubha Govind 2012 年 9 月 7 日
See TAB's answer for R2007b.
niharika
niharika 2012 年 9 月 8 日
Thank you very much Tab for your reply... it worked out for me.

サインインしてコメントする。

カテゴリ

製品

質問済み:

2012 年 9 月 6 日

Community Treasure Hunt

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

Start Hunting!

Translated by