moving a value under a certain value

A have a structure with a cell aray called textdata. The cells in column 2 are filled with the words abc or efg. In the case a cell of this column contains efg, I like to replace the value from column 3 (same row) with the value of column 4. How can I do that? Thank you

8 comentarios

KSSV
KSSV el 7 de Abr. de 2018
Attach your data..
Erik Verdijk
Erik Verdijk el 7 de Abr. de 2018
I made an example in excel.
Erik Verdijk
Erik Verdijk el 9 de Abr. de 2018
Can someone help me please? dónt want´to be rude.
KSSV
KSSV el 9 de Abr. de 2018
Attach the excel sheet...not image snippet....
Walter Roberson
Walter Roberson el 9 de Abr. de 2018
How are you reading it in? Are you looking at the raw data?
Erik Verdijk
Erik Verdijk el 9 de Abr. de 2018
Excel file format is not allowed
Walter Roberson
Walter Roberson el 9 de Abr. de 2018
zip the file and attach the zip

Respuestas (1)

Walter Roberson
Walter Roberson el 9 de Abr. de 2018
mask = strcmp(raw(:,2), 'efg');
raw(mask, 3) = raw(mask, 4);

La pregunta está cerrada.

Etiquetas

Preguntada:

el 7 de Abr. de 2018

Cerrada:

el 20 de Ag. de 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by