Azzera filtri
Azzera filtri

how do i get the last points of every 100 points from a 1000 point graph

7 visualizzazioni (ultimi 30 giorni)
x=0:1000
y=sin(x)
for N=0:100:length(x)
if N>N-50
N
end
end
this is what i have and i know its not right so please help
  4 Commenti
Image Analyst
Image Analyst il 6 Lug 2018
Huh? Is Carlos deleting his responses? All I see is this:
"how do i get the last points of every 100 points from a 1000 point graph"
x=0:1000
y=sin(x)
for N=0:100:length(x)
if N>N-50
N
end
end
Which is very confusing in itself.

Accedi per commentare.

Risposta accettata

per isakson
per isakson il 6 Lug 2018
Modificato: per isakson il 6 Lug 2018
"how do i get the last points of every [sequence of] 100 points from a [sequence of] 1000 point[s]" That's my interpretation of your question.
What about
>> x((100:100:1000))
ans =
99 199 299 399 499 599 699 799 899 999
>> y((100:100:1000))
ans =
-0.9992 -0.8818 -0.5216 -0.0177 0.4910 0.8645 1.0000 0.8601 0.4834 -0.0265
>>
Notice
>> length(x)
ans =
1001

Più risposte (0)

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by