# Help Required in using the function 'removerows' and its reverse function

1 visualización (últimos 30 días)
Avijit Paul el 1 de Dic. de 2023
Comentada: Avijit Paul el 2 de Dic. de 2023
Hello
I have column matrix 'rain'
d=find(rain>=1.0); %Index of rainfall more than 1mm/h
[x,position]=removerows(rain,'ind',d);
high_rain=rain(rain>=1.0); %Column matrix with only high rains
high_rain=high_rain*2.5; % Manipulate High_rain
%manipulate_rain=removerows('reverse',x,position);
I wanted to reinsert the high_rain back to rain variable using the reverse function of removerows. How to do that.
##### 0 comentariosMostrar -2 comentarios más antiguosOcultar -2 comentarios más antiguos

Iniciar sesión para comentar.

Image Analyst el 1 de Dic. de 2023
You can't. See:
x1 = [1 2 4; 1 1 1; 3 2 2; 0 0 0]
x1 = 4×3
1 2 4 1 1 1 3 2 2 0 0 0
[y1,ps] = removerows(x1,'ind',[2 4])
y1 = 2×3
1 2 4 3 2 2
ps = struct with fields:
name: 'removerows' xrows: 4 yrows: 2 remove_ind: [2 4] keep_ind: [1 3] no_change: 0
% Reverse the processing of y1 to get x1 again.
x1_again = removerows('reverse',y1,ps)
x1_again = 4×3
1 2 4 NaN NaN NaN 3 2 2 NaN NaN NaN
Even the help says:
In the reverse calculation, the unknown values of replaced rows are represented with NaN values.
If you want rain, then just keep it in scope. If, for some reason, you want to multiply high rain values by some factor, you can use masking:
rain = 5 * rand(10, 1)
mask = (rain>=1.0) %Index of rainfall more than 1mm/h
##### 1 comentarioMostrar -1 comentarios más antiguosOcultar -1 comentarios más antiguos
Avijit Paul el 2 de Dic. de 2023
Thanks a lot

Iniciar sesión para comentar.

### Categorías

Más información sobre Image Arithmetic 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