Info
Cette question est clôturée. Rouvrir pour modifier ou répondre.
trying to delete 2 cells of Nans, NOT To delete the row
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I am trying to get rid of the 2 Nans in two columns that are produced in the av_pwrmn, sdav_pwrmn, PPWRM and sdpeak_pwr JHSD and JHMN. They are always in the same place, [row col] = 2 5 and 4 6. However I want to make the code as universal as possible so I could apply it to another code just similar to this one.
i don't know if an 'if' statement would work? i did try to use nancov but it gave me a 7x7 matrix instead of a 4x7 matrix.
% finding mean and SD
for ii=1:6;
for jt= 1:4;
x= find(JT_S_TN(:,1)==ii);
y= find(JT_S_TN(x,2)==jt);
JHMN(jt,ii)= mean(jh(x(y)));
JHSD(jt,ii)= std(jh(x(y)));
av_pwrmn(jt,ii)= mean(av_pwr(x(y)));
sdav_pwr(jt,ii)= std(av_pwr(x(y)));
PPWRM(jt,ii)= mean(peak_pwr(x(y)));
sdpeak_pwr(jt,ii)= std(peak_pwr(x(y)));
av_pwrmn1= nancov(av_pwrmn); % my attempt at nancov
end
end
5 commentaires
Réponses (1)
George Papazafeiropoulos
le 20 Mai 2014
At least one of the values of JT_S_TN([13,14,15,34,35,36,55,56,57,76,77,78],2) must be equal to 2
and
at least one of the values of JT_S_TN([16,17,18,37,38,39,58,59,60,79,80,81],2) must be equal to 4
for the loop to give results without NaN values
2 commentaires
George Papazafeiropoulos
le 20 Mai 2014
At least one of the values in the second column of JT_S_TN, and rows 13,14,15,34,35,36,55,56,57,76,77,78 must be equal to 2. Respectively for positions 16,17,18,37,38,39,58,59,60,79,80,81 of the same column, same matrix, there must be a 4.
Cette question est clôturée.
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!