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

Thread Subject:
expanding window + dimension mismtach

Subject: expanding window + dimension mismtach

From: Saad

Date: 6 Nov, 2013 17:58:09

Message: 1 of 1

Dear all,

I would like to do an expanding window as follows:

Say we have a vector X which is (1000,1) and contain some values

%%
j=60;
while j <= 1000

R=X(1:100+j,:); %% we expand the selection of elements of X at each loop

end
%%
My issue is that there is a dimension mismatch at the last expansion. How can I tell the code to keep reducing the size of the expanding window (i.e. < 60) at the last expansion until the size of the last window fits the size of what remains from vector X?

For instance, can I use an "if statement" to reduce 60 until both sizes match?
The code that I presented above is a simplified version of what I have written and i would like to keep the while statement if possible.

Thank you very much for your help

S

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us