Reshaping different matrixces of different sizes to a 1 tot 100 procent scale to calculate the mean
3 views (last 30 days)
Show older comments
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
0 Comments
Answers (1)
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
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);
See Also
Categories
Find more on Matrix Indexing 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!