Effacer les filtres
Effacer les filtres

how to find the difference between first column and second column in a cell array

1 vue (au cours des 30 derniers jours)
I am a having cell
C=5x1 cell
which contains
10x2 double
10x2 double
10x2 double
10x2 double
10x2 double
I need to find the difference between first and second column of C. Could anyone please help me on it.

Réponse acceptée

Simon Chan
Simon Chan le 18 Juil 2021
cellfun(@(x) x(:,1)-x(:,2),C,'UniformOutput',false)
  5 commentaires
jaah navi
jaah navi le 18 Juil 2021
I used the command
D=cellfun(@(x) sum((x(:,1)-x(:,2)).^2)/10,C,'UniformOutput',false)
Now I want to sum D and divide by 5.
Could you please help me on this.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Multidimensional Arrays dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by