hi my matrix=12x5, i need to subtract all these and finally get 12x1 i.e 12x1-12x2, result of (12x1-12x2)-12x3,then result of ((12x1-12x2)-12x3)-12x4..................so on
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
kaavya subramani
le 29 Déc 2016
Réponse apportée : Roger Stafford
le 29 Déc 2016
plz help me with matlab code
0 commentaires
Réponse acceptée
Ahmed raafat
le 29 Déc 2016
you said that your matrix is 5 cols so (your matrix variable is mat
out=mat(:,1);
for i=2:5
out=out-mat(:,i);
end
This worked for me alot
0 commentaires
Plus de réponses (1)
Roger Stafford
le 29 Déc 2016
Let M be your 12 by 5 matrix and V your result.
V = M(:,1)-sum(M(:,2:end),2);
0 commentaires
Voir également
Catégories
En savoir plus sur Historical Contests dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!