Creating a two matrices from 2 existing matrices according to a rule
Show older comments
Hi all,
I am new to matlab and I have been trying to create a rule for the past couple of days, unfortunately unsuccessful I hope that someone here would be able to help me.
Here is the problem:
I have two matrices Y ( 1 column vector with 10 000 entries) and X (matrix with 4 columns, 10 000 entries in each). I want to create new matrix Y and X according to the following rule, Matrix X should contain the same 4 columns but only 50 observations, and the rule: it should contain the first 50 observations in absolute value from column 3 and the corresponding elements (to the observations in column 3) from column 1, 2 and 4. It should take also the corresponding elements of vector Y to the first 50 observations in absolute value in column 3 of X. And it should save them in new matrices Y1 and X1. And here is the most challenging part: It should do this 200 times increasing the number of observations each time by 50 (meaning the first 50 in absolute value in column 3 in X + the second 50 in absolute value in column X, etc.)
I am really puzzled how to do this and I hope somebody can help me.
Thank you all for your help and time!
1 Comment
Oleg Komarov
on 12 May 2012
Please post brief examples and what you attempted so far.
Accepted Answer
More Answers (0)
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!