Separating data to 3 different groups according to specific range of number in a variable
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Yat Chi
el 22 de Feb. de 2024
Comentada: Dyuman Joshi
el 22 de Feb. de 2024
Hello, I have a 32x1875 sized variable named SNR_GPS, each rows represent the number of signals to noise ratio (SNR) of each satellite in the 1875 seconds. The first thing I would like is to calculate the mean SNR of each satellite which I successfully done do. But when I would like to arrange the satellites into 3 separate variables according to the requirements ( First group: SNR < 25, Second group: SNR 25-35, Third group: SNR>35 ), my old code failed to compile that. Is there any method to complete that? Thanks for your help.
0 comentarios
Respuesta aceptada
Dyuman Joshi
el 22 de Feb. de 2024
Note - NaN values are not included in the grouping
load('SNR_GPS.mat')
data = SNR_GPS(~isnan(SNR_GPS))
k = discretize(data, [-Inf 25 36 Inf])
out = accumarray(k, data, [], @(x) {x})
%checking the data
z = out{2}
min(z)
max(z)
8 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Reference Applications en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!