Compare two cell arrays of different sizes
7 views (last 30 days)
Show older comments
I have two cell arrays of different sizes final_iono=68x2 cell and final_gps=288x2 cell as follows:
final_iono= Column 1('00:05','00:10','00:15'...) and Column 2 ([7.62],[7.78],[7.50]...);
final_gps= Column 1('00:05','00:20','00:35'...) and Column 2 ([109.56],[107.24],[98.22]...).
I need to compare the Column 1 of the cell array final_gps with cell array final_iono, and create a new cell array C using the following math operation:
C= Col1('00:05'), then Col2= (7.62^3/109.56) then, Col2= 4.038
So,
C= '00:05' [4.038]
Follow below an example.
Any help will be appreciate!
0 Comments
Accepted Answer
Andrei Bobrov
on 7 Dec 2013
Edited: Andrei Bobrov
on 8 Dec 2013
[l,ii] = ismember(final_gps(:,1),final_iono(:,1));
C = cat(1,final_gps{l,2}).^3./cat(1,final_iono{ii(l),2});
ADD
l = ismember(final_gps(:,1),final_iono(:,1));
C = cat(1,final_gps{l,2}).^3./cat(1,final_iono{:,2});
6 Comments
More Answers (0)
See Also
Categories
Find more on Data Type Identification in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!