trying to delete 2 cells of Nans, NOT To delete the row
Información
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
Mostrar comentarios más antiguos
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 comentarios
George Papazafeiropoulos
el 20 de Mayo de 2014
What are the arrays JT_S_TN, jh, av_pwr and peak_pwr? Could you give their typical values?
Adrienne
el 20 de Mayo de 2014
George Papazafeiropoulos
el 20 de Mayo de 2014
What about jh?
Adrienne
el 20 de Mayo de 2014
Adrienne
el 20 de Mayo de 2014
Respuestas (1)
George Papazafeiropoulos
el 20 de Mayo de 2014
0 votos
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 comentarios
Adrienne
el 20 de Mayo de 2014
George Papazafeiropoulos
el 20 de Mayo de 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.
La pregunta está cerrada.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!