replace numeric char within a column

1 visualización (últimos 30 días)
julro
julro el 5 de Jul. de 2014
Comentada: Image Analyst el 6 de Jul. de 2014
Hey,
I would like to replace numbers (-999) as char with a 0 for all -999 in a specific column.
Thanks already!

Respuesta aceptada

Titus Edelhofer
Titus Edelhofer el 6 de Jul. de 2014
Hi,
it sounds as if you have a cell array of strings. In this case
allDatabySubj(strcmp(allDatabySubj, '-999)) = {0};
should do the trick.
Titus
  1 comentario
Image Analyst
Image Analyst el 6 de Jul. de 2014
julro's "Answer" moved here since it's not an ANswer/solution to the original question:
Thanks a lot! That was the trick:).

Iniciar sesión para comentar.

Más respuestas (1)

dpb
dpb el 6 de Jul. de 2014
x(x(:,colID)==-999,colID)=0;
for your specific column in colID
  3 comentarios
dpb
dpb el 6 de Jul. de 2014
It doesn't make any sense and I don't know what was intended by it either but I am guessing it is just poor grammar from non-English native tongue poster...
Image Analyst
Image Analyst el 6 de Jul. de 2014
julro's "Answer" moved here since it's not an ANswer/solution to the original question:
Thanks! Char means character, sorry. I am getting the following error message:
>> allDatabySubj(allDatabySubj(:,6)==-999,6)=0; ??? Undefined function or method 'eq' for input arguments of type 'cell'.

Iniciar sesión para comentar.

Categorías

Más información sobre Entering Commands 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