Insert certain percentages of missing values in a dataset

1 visualización (últimos 30 días)
MOHAMAD FAIZ DZULKALNINE
MOHAMAD FAIZ DZULKALNINE el 25 de Feb. de 2021
Comentada: KSSV el 25 de Feb. de 2021
I have a dataset with a certain dimension. For example 600x10. I want to insert missing values randomly in the dataset in certain percentages such as 10% or 20%.
Can anyone help please? Thank you.

Respuesta aceptada

KSSV
KSSV el 25 de Feb. de 2021
Editada: KSSV el 25 de Feb. de 2021
A = rand(600,10) ; % demo data
N = numel(A) ; % number of elements
idx = randperm(N,10/100*N) ; % get 10% of data indices randomly
A(idx) = NaN ; % replace the indices with NaN, these are missing
  2 comentarios
MOHAMAD FAIZ DZULKALNINE
MOHAMAD FAIZ DZULKALNINE el 25 de Feb. de 2021
Wow, thank you so much for the swift help. Really appreciate it.
KSSV
KSSV el 25 de Feb. de 2021
Thanks is accepting/ vorting the asnwer.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Descriptive Statistics 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!

Translated by