Hi,
I have a cell array(1×316) which contains 316 double numeric arrays of various sizes like
{74845×2 double}, {81032×2 double}, {87351×2 double},…..
sample of one array inside the cell-array :
{74845x2}= 0.194 0.0043 0.116 0.0040 0.118 0.0041 0 0.0044 0 0.0037 0 0.0042 0.045 0.0041 0.151 0.0043 0 0.231 0.0040 0 ..................... .....................
Now, Steps to be taken: 1)
Check if the first column values are non-zero,if it is true then, find difference of elements in first and second column separately.
EDIT
There are two cases here:
case i)If there are more than one non-zero elements together in first column then,
find the maximum and minimum values in the group and compute difference as (max-min).
d11 = 0.194(max among 0.118, 0.116, 0.194)- 0.116(Min value of those)
d12 = 0.0043(max among 0.0041, 0.0040, 0.0043)- 0.0040(min of those)
d21 = 0.151-0.045 d22 = 0.0043-0.0041
case ii)If there is only one non-zero element in the first column, no need to take difference.The output should be same.
d31 = 0.231 d32 = 0.0040
2)At last, remove all the zero values from all arrays in the cell.
This way, i need to compute differences among non-zero elements from all the 316 arrays in the cell array and save the results in a new cell array of original size 1×316.
Please help me out on this.
Thanks in advance!
Best Answer