How to count the number of non-nan values for combination of multiple variables
Hello, I would like to count the number of non-nan values in the d column for unique combinations of a, b and c (i.e I want to generate the e column in tt). If any a,b or c are NaN then the count should be nan as well
% Initial table
a = [1,1,1,2,2,2,2]’
b = [660, 661, 661, 663, 663, NaN, 663]’
c = [1,2,2,5,5,NaN,6]’
d = [11,12,NaN, 13, 14, NaN,5]’
t = table(a,b,c,d)
% Desired output
a = [1,1,1,2,2,2,2]’
b = [660, 661, 661, 663, 663, NaN, 663]’
c = [1,2,2,5,5,NaN,6]’
d = [11,12,NaN, 13, 14, NaN,5]’
e = [1, 1, 1, 2, 2, NaN, 1]’
tt = table(a,b,c,d,e)Hello, I would like to count the number of non-nan values in the d column for unique combinations of a, b and c (i.e I want to generate the e column in tt). If any a,b or c are NaN then the count should be nan as well
% Initial table
a = [1,1,1,2,2,2,2]’
b = [660, 661, 661, 663, 663, NaN, 663]’
c = [1,2,2,5,5,NaN,6]’
d = [11,12,NaN, 13, 14, NaN,5]’
t = table(a,b,c,d)
% Desired output
a = [1,1,1,2,2,2,2]’
b = [660, 661, 661, 663, 663, NaN, 663]’
c = [1,2,2,5,5,NaN,6]’
d = [11,12,NaN, 13, 14, NaN,5]’
e = [1, 1, 1, 2, 2, NaN, 1]’
tt = table(a,b,c,d,e) Hello, I would like to count the number of non-nan values in the d column for unique combinations of a, b and c (i.e I want to generate the e column in tt). If any a,b or c are NaN then the count should be nan as well
% Initial table
a = [1,1,1,2,2,2,2]’
b = [660, 661, 661, 663, 663, NaN, 663]’
c = [1,2,2,5,5,NaN,6]’
d = [11,12,NaN, 13, 14, NaN,5]’
t = table(a,b,c,d)
% Desired output
a = [1,1,1,2,2,2,2]’
b = [660, 661, 661, 663, 663, NaN, 663]’
c = [1,2,2,5,5,NaN,6]’
d = [11,12,NaN, 13, 14, NaN,5]’
e = [1, 1, 1, 2, 2, NaN, 1]’
tt = table(a,b,c,d,e) sum MATLAB Answers — New Questions