editing a variable

I have a 1x50 structured array. However, there is only values in the last 10 cells.
Is it possible to turn this into a 1x10 structured array and how?

답변 (3개)

Rick Rosson
Rick Rosson 2011년 8월 6일

0 개 추천

Please try:
Y = X(41:50);
OR:
Y = X(end-9:end);
HTH.
Rick
Fangjun Jiang
Fangjun Jiang 2011년 8월 6일

0 개 추천

Or X(1:end-10)=[]
James
James 2011년 8월 6일

0 개 추천

Thanks all!

댓글 수: 1

Oleg Komarov
Oleg Komarov 2011년 8월 6일
Please accept the answer you feel best answered your needs.

이 질문은 마감되었습니다.

태그

질문:

2011년 8월 6일

마감:

2021년 8월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by