MATLAB Answers

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

4 views (last 30 days)
jaah navi
jaah navi on 18 Jul 2021
Commented: Simon Chan on 18 Jul 2021
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.

Accepted Answer

Simon Chan
Simon Chan on 18 Jul 2021
cellfun(@(x) x(:,1)-x(:,2),C,'UniformOutput',false)
  5 Comments

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by