step size = (Tmax-Tmin)/50
my question is why it should divided by 50?

4 commentaires

John D'Errico
John D'Errico le 9 Mar 2018
Out of context, the only answer is because the sky is blue. (Ok, it will be blue, somewhere. It is fairly black right now for me.)
My guess is there are intended to be 51 steps.
Stephen23
Stephen23 le 9 Mar 2018
@sk karimulla: what would you divide it by?
Note that without any context or description of where this code is used we have no idea what this code and its values are used for.
sk karimulla
sk karimulla le 9 Mar 2018
It is formula for step size,step size is used to solve the simulink model.step size = (Tmax-Tmin)/50, in this formula why 50 is taken to calculate the step size.
Rik
Rik le 9 Mar 2018
Without more specific context of your system it is still impossible to give you a more meaningful answer. Apparently the units that Tmin and Tmax are in are 50 times larger than the step size of the model, or there should be 50 steps, or any other reason.

Connectez-vous pour commenter.

 Réponse acceptée

Abraham Boayue
Abraham Boayue le 9 Mar 2018
Modifié(e) : Rik le 25 Août 2018

0 votes

HI SK, Let say you have a function f (t) and you want to plot it between t = Tmin and Tmax, in matlab, you have to choose a step size to do so. The step size is defined as delta = (Tmax-Tmin)/(N-1), This is exactly what the function linspace does. The following are equivalent :
N = 51;
stepsize = (Tmax-Tmin)/50;
t = Tmin:stepsize:Tmax;
t = linspace (Tmin, Tmax, 50);

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by