フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

how can i gather points of a graph when its running a number of times?

2 ビュー (過去 30 日間)
Carlos Nunez
Carlos Nunez 2018 年 7 月 5 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Let say I have an X number of points like 100, so for every 10 points I want the last 5 points so when its 20 I want the last 5 points and so on
  3 件のコメント
Carlos Nunez
Carlos Nunez 2018 年 7 月 5 日
y=sin(x). this would be my input, what I want is for every 10 points I want 5-10 and once I have 20 points I want 15-20 and so on.
Carlos Nunez
Carlos Nunez 2018 年 7 月 5 日
Can you Please help me out with this

回答 (1 件)

James Tursa
James Tursa 2018 年 7 月 5 日
Is this what you want:
y = your vector
yr = reshape(y,10,[]);
result = yr(5:10,:);
result = reshape(result,1,[]);
  2 件のコメント
Carlos Nunez
Carlos Nunez 2018 年 7 月 5 日
編集済み: James Tursa 2018 年 7 月 6 日
No what I want let's say this is the code
y=1:100
x=sin(y)
for y=length(x)
if y<5
This is where I get stuck I want to be able to tell my for loop I only want whatever is greater after 5 so 5-10 and the process would repeat itself again but this time the numbers would be through 10-20 and the for loop would only give 15-20
James Tursa
James Tursa 2018 年 7 月 6 日
編集済み: James Tursa 2018 年 7 月 6 日
As near as I can tell from your wording, that is exactly what my posted code does. Since you state this is not what you want, you will need to provide us with the explicit output you want for this example before we can understand. I.e., give us the exact numbers in the resulting vector that you would want for a result.

この質問は閉じられています。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by