How can I send variable from workspace to simulink?

I have a simulink model. And ı have a constant block that ı want to send to variable from workspace. How can I send?

回答 (1 件)

Fangjun Jiang
Fangjun Jiang 2018 年 2 月 15 日

0 投票

If you have the variable 'a' in base workspace, double click the Constant block, put in 'a' (without the quote) under "Constant value:"

7 件のコメント

bayram özmen
bayram özmen 2018 年 2 月 15 日
yes I did. But ı want to send different value. for example my constant variable A. And ı am gonna simulate for A is from 0 to 30. I am writing for cycle like for A=0:30 . But When I simulated , while ıt simulates for only A is 30.
Fangjun Jiang
Fangjun Jiang 2018 年 2 月 15 日
which one you want?
1. A is changing from 0 to 30, increased by 1 at a time, run the simulation 31 times, or
2. Run the simulation just one time but the value of A is changing from 0 to 30? (you still need to specify how A is changed depending on the simulation time)
bayram özmen
bayram özmen 2018 年 2 月 15 日
I want the second one. I want to simulate just one time.
Fangjun Jiang
Fangjun Jiang 2018 年 2 月 15 日
In that case, it is not a "Constant" any more. Use the "Repeating Sequence" block from "Source" library. Specify the [StartTime EndTime] and [StartValue EndValue].
bayram özmen
bayram özmen 2018 年 2 月 15 日
ıt gıves error like in photo.
Fangjun Jiang
Fangjun Jiang 2018 年 2 月 15 日
That is something on a different topic. Double click the "Simulinnk-PS Converter" block, read the description regarding "derivatives", click the "Input Handling" panel, play with the "Filtering and derivatives" and "Provided signals:" settings.
bayram özmen
bayram özmen 2018 年 2 月 15 日
Thank you so much.In ınput handling ı set the second-order filtering and then simulated. But ı did not understand the reason exactly.

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

カテゴリ

製品

タグ

質問済み:

2018 年 2 月 15 日

コメント済み:

2018 年 2 月 15 日

Community Treasure Hunt

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

Start Hunting!

Translated by