Combining two different matrices of different sizes
Afficher commentaires plus anciens
I want to combine two different matrices with a different number of columns so that the output has the lower number of columns. I also want the columns that were "modified" to have the average value of what they were modified. I think these examples clarify what I'm trying to say:
For example, for matrices that are multiples of each other:
A=[5 6]
B=[1 2 3 4]
I would combine these matrices so
C=[5 6; 1.5 3.5]
Now if the matrices aren't multiples of each other, then it would combine to whichever value it finds fit, for example:
A=[5 6]
B=[1 2 3 4 5]
Then the output is:
C=[5 6; 2 4.5] (The first 3 values were averaged)
Thanks
2 commentaires
Azzi Abdelmalek
le 10 Jan 2013
What is the size of A?
Jan
le 10 Jan 2013
The question is not clear. What happens for other number of columns for A and C?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Get Started with MATLAB dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!