Effacer les filtres
Effacer les filtres

Subtracts Two Cell Arrays to Yield a Third Array

1 vue (au cours des 30 derniers jours)
Maskus Kit
Maskus Kit le 5 Avr 2021
Commenté : Maskus Kit le 5 Avr 2021
Hello friends,
I've got two cell arrays of equal size. How do I go about subtracting them to create a third cell array ouput?
Thanks.

Réponse acceptée

KSSV
KSSV le 5 Avr 2021
Modifié(e) : KSSV le 5 Avr 2021
Let C1 and C2 be two cell arrays of equal size and having same data each cell.
N = length(C1) ;
iwant = cell(N,1) ;
for i = 1:N
iwant{i} = C1{i} - C2{i} ;
end
Or use cellfun
iwant = cellfun(@minus,C1,C2,'UniformOutput',false) ;

Plus de réponses (0)

Catégories

En savoir plus sur Matrices and Arrays 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!

Translated by