필터 지우기
필터 지우기

Extract only odd rows in a matrix

조회 수: 11 (최근 30일)
Brilliant Purnawan
Brilliant Purnawan 2021년 3월 8일
답변: Matt J 2021년 3월 8일
Hi, how would I modify the following code if I only want to extract the odd rows in the output matrix. The output is generated by ODE45 and I am referring to the third variable. I have already tried to use the matrix indexing in matlab but it's not working. How would I go about this? If my output is given as below?
m = y(:,3);

답변 (1개)

Matt J
Matt J 2021년 3월 8일
m=y(1:2:end,3);

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by