Simulink: Understanding Time Steps and Sampling Frequencies

To add an input variable that is not a constant, you first need to create a new block in the workspace. In the block's properties, set the Type to "Input Variable" and the Name to the variable you want to use.
  • #1
167
0
Hi,

I have a project due that has to be done in Simulink.

I am somewhat familiar with Simulink, but some things don't make sense to me.

First off, What determines the time step between each iteration? eg. when you have a clock in the model, what determines the change in time from one iteration to the next?

I remember working with a model once, and changing something in the model changed the sampling frequency for some reason, shich makes no sense to me.

Thanks

Raman
 
Engineering news on Phys.org
  • #2
You can change the step size in the settings of the menu bar along with what kind of numeric solver it uses. i.e. ode45,ode23, etc.
 
  • #3
So if I have a input array which is to be used in the system, then I have to make sure the values in the input array are spaced the same time apart as the step size I specify in Simulink Options?
 
  • #4
How do I add an imput variable that is not a constant?

I have an array of values that I want the system to use, but I don't know how to get it to read the array one element at a time (each iteration I want it to take in one value from the array, and as it goes on it will read down the array).

Thanks
 
Last edited:
  • #5
swraman said:
So if I have a input array which is to be used in the system, then I have to make sure the values in the input array are spaced the same time apart as the step size I specify in Simulink Options?

I'm not sure, I would google that or look on the mathworks website. It may well be that simulink just interpolates points if it needs to.
 
  • #6
swraman said:
How do I add an imput variable that is not a constant?

I have an array of values that I want the system to use, but I don't know how to get it to read the array one element at a time (each iteration I want it to take in one value from the array, and as it goes on it will read down the array).

Thanks

Again, a question for the mathworks forums.
 
  • #7
thanks i was able to solve itl its just the "from workspace" block.
 

Suggested for: Simulink: Understanding Time Steps and Sampling Frequencies

Replies
7
Views
1K
Replies
3
Views
924
Replies
1
Views
869
Replies
2
Views
2K
Replies
1
Views
2K
Back
Top