How to add two vectors or arrays with different length?
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Dear all , Anyone could help to substract or add two vectors ith different length.For instance , if i have these to vectors
a=[1 2 0 3 0 4 ] with six elements b=[1 2 3 4 5 6 7 8 9] with 9 elements. My question as follow: .First ,i have to make the a-vectors by skipping all zeros values as new a=[1 2 3 4].
.Then , i have to add the new vector of a with b exactly each element in a to each element of b, and the zeros element of a should not be inculded for the assigned values in b.The results should be as anew = [ 1 2 3 4 ] bnew= [1 2 4 6 ] anew+bnew =[2 4 7 10] Please if you can help me as soon as possible. Regards mah
0 Kommentare
Antworten (1)
Siehe auch
Kategorien
Mehr zu Data Distribution Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!