About null values
Mostrar comentarios más antiguos
Hi,
I'm using importdata(file) function to extract the file information as a matrix. Until now there isn't any problem.
However, when I catch a file where there are a null values,the function only obtains the previous lines until the first line where there is a null values.
How can I configure this function for not omit the null values?
thanks
regards
3 comentarios
REN
el 7 de Mzo. de 2011
if isempty(x)
or
function: isnan([test values here])
Andrew Newell
el 7 de Mzo. de 2011
Importdata isn't bothered by zeros. It ignores blank lines and variable spacing between numbers, and can even handle missing data elements in a row (by appending NaN's to the end of the row). So what do you mean by null values?
Mtlb Usr
el 7 de Mzo. de 2011
Respuesta aceptada
Más respuestas (1)
Matt Tearle
el 7 de Mzo. de 2011
1 voto
It sounds like this is a delimited text file, in which case I'd recommend using textscan. It will use NaN in place of missing values. You can also specify the TreatAsNan option to tell it that certain patterns are missing values.
Categorías
Más información sobre Resizing and Reshaping Matrices en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!