Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

How to set simulation to calculate every one second time

Asked by Arun Badigannavar

Arun Badigannavar

on 5 Dec 2012
Accepted Answer by Azzi Abdelmalek

Azzi Abdelmalek

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

1 Comment

Arun Badigannavar

Arun Badigannavar

on 5 Dec 2012

HEP ME OUT,,

Arun Badigannavar

Arun Badigannavar

Products

No products are associated with this question.

2 Answers

Answer by Azzi Abdelmalek

Azzi Abdelmalek

on 5 Dec 2012
Edited by Azzi Abdelmalek

Azzi Abdelmalek

on 5 Dec 2012
Accepted answer

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 Comments

Arun Badigannavar

Arun Badigannavar

on 5 Dec 2012

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

on 5 Dec 2012

I can't tell you, I did'nt work with s-function.

Arun Badigannavar

Arun Badigannavar

on 6 Dec 2012

okay,,thanks Mr Azzi

Azzi Abdelmalek

Azzi Abdelmalek

Answer by Vishal Rane

Vishal Rane

on 5 Dec 2012

I guess this query is already answered here by Walter Roberson :

http://www.mathworks.in/matlabcentral/answers/26276-real-time-simulation

0 Comments

Vishal Rane

Vishal Rane

Contact us