How do I set an equation to use a section of time?

1 Ansicht (letzte 30 Tage)
Calvin Wynn
Calvin Wynn am 16 Nov. 2016
Bearbeitet: Walter Roberson am 16 Nov. 2016
For instance, I am attempting to use a formula for a set of data I have amassed, and I need to create a graph with this data. I know how to create the graph, but I am struggling with the equation. In the equation I need to go from 0 to 100, but only in intervals of 5. For instance, T1=0 and T2=5, then the next T1=5 and T2=10. This needs to go on until I hit 100. Is there a simple way of doing this?

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 16 Nov. 2016
T1 = 0 : 5 : 100-5;
T2 = T1 + 5;
and now you can use vectorized code.
  2 Kommentare
Calvin Wynn
Calvin Wynn am 16 Nov. 2016
Is there also a way to do this with a 1x100 column vector?
Walter Roberson
Walter Roberson am 16 Nov. 2016
Bearbeitet: Walter Roberson am 16 Nov. 2016
T1 = (0 : 5 : 100*5-5).'
T2 = T1 + 5;

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Networks finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by