Reshaping different matrixces of different sizes to a 1 tot 100 procent scale to calculate the mean

1 view (last 30 days)
Hello,
Suppose we have the following problem:
We have 3 matrices with data A [130x1] B [123x1] C [175x1]
How can we convert/reshape all matrices to the same size [100x1] without losing any information.
Saying A_2 = A[1:100,:] is not the way we want to, because we'll lose all information after the 100th row
This is needed to calculate the mean of the 3 matrices in a scale of 1-100%
Thanks in advance

Answers (1)

Image Analyst
Image Analyst on 17 Dec 2013
One way is to take the upper 30 elements (elements 101-130) and multiply them by a factor, say like a million, and add them to elements 1-30, then crop off the last 30 elements like you did. So the information is still there but coded into the first 30 elements. But that doesn't seem like it has anything to do with getting the mean. Why do you want to do this unusual thing anyway?
  2 Comments
Louis
Louis on 17 Dec 2013
These 3 matrices represent the joint angles of the same movement (but each time another trial)
Every Trial has a different length that we have to "normalize" to compare the values. The first and the last values are the beginning and the end of each trial.
You can say that the starting and end value are more or less the same for the 3 matrices. But they are distributed differently between these values.
Can we normalize the trials and then calculate the mean on every point. (for example: going from 1 - 100)?
Image Analyst
Image Analyst on 17 Dec 2013
A diagram or screenshot or image or something to illustrate this would help. Do you want to use interp1() to just interpolate/resample your array so that it spans the same number of elements?
newArray = interp1(x, y, 1:100);

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!