reading input from workspace in simulink

is there any work arround to read input data from workspace without using fromworkspace component in simulink so that i can read these data irrespective to define time column
thanks in advance

回答 (2 件)

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 3 月 2 日
編集済み: Azzi Abdelmalek 2013 年 3 月 2 日

0 投票

You can use a constant block from simulink/sources

7 件のコメント

Niveen Morsi
Niveen Morsi 2013 年 3 月 2 日
i want to read this data under certain condition occurance, thats why i don't want it to be bind with time..
any idea...
Azzi Abdelmalek
Azzi Abdelmalek 2013 年 3 月 2 日
What do you mean: under certain condition occurance, give an example
Azzi Abdelmalek
Azzi Abdelmalek 2013 年 3 月 2 日
編集済み: Azzi Abdelmalek 2013 年 3 月 2 日
There are multiple ways:
Used with a constant block
Niveen Morsi
Niveen Morsi 2013 年 3 月 2 日
well.. i'm using hdl cosimulink block that takes its input from workspace but this is based upon its output flag.. this flag is set to 1 once calculation within this block is done and returns to zero when it starts new calculation..
in the work space there is a matrix of 10 values i want to take these values one by one every time the flag is set to "1"..
first to overcome this i had found out how long it takes to finish and take the next value..
but this is not working now with my code as i had added a condition that may stop these calculation and fetch the next value...
any idea plzzz..
Azzi Abdelmalek
Azzi Abdelmalek 2013 年 3 月 2 日
You can use Matlab function block (Formerly named Embedded function). You can use A(k), A is your array, you can declares k as persistent, and increment it when it's necessary.
Niveen Morsi
Niveen Morsi 2013 年 3 月 3 日
thanks alot Azzi..
but there is a problem on using embedded function block..
whenever i call other matlab functions like randint() or randi() i got an error that its not supported also if i used my own defined function...
any idea how to overcome this plzz..???
Azzi Abdelmalek
Azzi Abdelmalek 2013 年 3 月 3 日
Then use Interpreted Matlab function (Formerly called Matlab Function)

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

TAB
TAB 2013 年 3 月 4 日

0 投票

Use a Constant block to import the complete matrix from workspace at once. Further use Demux or Index Vector to decompose the matrix into its elements.
No need to fetch the matrix elements one by one from workspace.

カテゴリ

ヘルプ センター および File ExchangeEvent Functions についてさらに検索

質問済み:

2013 年 3 月 2 日

Community Treasure Hunt

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

Start Hunting!

Translated by