How to skip an empty value
54 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Eliska Paulikova
el 27 de Feb. de 2023
Comentada: Fangjun Jiang
el 28 de Feb. de 2023
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1309135/image.jpeg)
Hello I work with this data in my program, but if there are empty spots, the program stops itself. I would like to now, how can I say to matlab to ignore these empty values or fill it with the previous value. Thank you so much
0 comentarios
Respuesta aceptada
Fangjun Jiang
el 27 de Feb. de 2023
You can use isempty(rp) to check, and then ignore as needed.
9 comentarios
Fangjun Jiang
el 28 de Feb. de 2023
In the code, you have this line "rp=radiiBright %v pixelech". It does not have the ";" at the end of line so every time "rp" got calculated, it displays at the Command Window as you showed.
You can add this right after to "skip".
if isempty(rp)
continue
end
The "continue" command will jump the execution to the end of the current loop and start executing the next loop.
This might help you avoid the problem at line
"r=fillmissing(rp + 0./(rp~=0), 'linear', 1)".
But it might also cause problem somewhere else.
Más respuestas (0)
Ver también
Categorías
Más información sobre Logical 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!