Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

editing a variable

Asked by James

James (view profile)

on 6 Aug 2011

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?

0 Comments

James

James (view profile)

Products

No products are associated with this question.

3 Answers

Answer by Rick Rosson

Rick Rosson (view profile)

on 6 Aug 2011

Please try:

   Y = X(41:50);

OR:

   Y = X(end-9:end);

HTH.

Rick

0 Comments

Rick Rosson

Rick Rosson (view profile)

Answer by Fangjun Jiang

Fangjun Jiang (view profile)

on 6 Aug 2011

Or X(1:end-10)=[]

0 Comments

Fangjun Jiang

Fangjun Jiang (view profile)

Answer by James

James (view profile)

on 6 Aug 2011

Thanks all!

1 Comment

Oleg Komarov

Oleg Komarov (view profile)

on 6 Aug 2011

Please accept the answer you feel best answered your needs.

James

James (view profile)

Contact us