Subtracts Two Cell Arrays to Yield a Third Array

1 visualización (últimos 30 días)
Maskus Kit
Maskus Kit el 5 de Abr. de 2021
Comentada: Maskus Kit el 5 de Abr. de 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.

Respuesta aceptada

KSSV
KSSV el 5 de Abr. de 2021
Editada: KSSV el 5 de Abr. de 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) ;

Más respuestas (0)

Categorías

Más información sobre Matrices and Arrays en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by