How to set simulation to calculate every one second time

I have model which calculates addition of two numbers a=1:1:100;,,,,,,,,b=1:1:100;,,,,,,,c=a+b;....this I have in simulink model ,,, I want to set my simulation time to 1 second,,I mean for 1 second it should perform c(1)=a(1)+b(1),,,,at 2 second time it should perform c(2)=a(2)+b(2),, at 3 second time it should perform c(3)=a(3)+b(3),,,,,,,,this should continue up to 100 seconds of time after that my simulink model should stop simulation and each second my c() value should be available to see it

 採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2012 年 12 月 5 日
編集済み: Azzi Abdelmalek 2012 年 12 月 5 日

0 投票

click on Simulation - Configuration parameters-Fixed step size to 1 or if you can't find just type in Matlab command
set_param('yourmodelname','FixedStep','1')

8 件のコメント

Arun Badigannavar
Arun Badigannavar 2012 年 12 月 5 日
No Its not meeting my requirments,,for above application it should take 100 second to perform the simulation,,but it does within asecond
Arun Badigannavar
Arun Badigannavar 2012 年 12 月 5 日
I mean to say simulink should perform each calculation at one second so it should run for 1 minute and 40 seconds for my above requirments
Azzi Abdelmalek
Azzi Abdelmalek 2012 年 12 月 5 日
Arun, you have to choose between a normal simulation, and a Real time simulation. If you are runing normal simulation, depending on your PC performances, the calculation can take less then a seconde, even a stop time is 100000 sec
Arun Badigannavar
Arun Badigannavar 2012 年 12 月 5 日
ya I want to go with this real time simulation,,,how will i do that,,Do u know that
Azzi Abdelmalek
Azzi Abdelmalek 2012 年 12 月 5 日
Have you RTW toolbox?
Arun Badigannavar
Arun Badigannavar 2012 年 12 月 5 日
You mean Real Time Windows Target toolbox?,,,I dn have this,,,I should buy RTWT toolbox if i want to acces real time simulation?,,,but i found in MATLAB Central , a s-function developed RT block,,,can i use that?
Azzi Abdelmalek
Azzi Abdelmalek 2012 年 12 月 5 日
I can't tell you, I did'nt work with s-function.
Arun Badigannavar
Arun Badigannavar 2012 年 12 月 6 日
okay,,thanks Mr Azzi

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

その他の回答 (1 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by