Info

此问题已关闭。 请重新打开它进行编辑或回答。

moving a value under a certain value

1 次查看(过去 30 天)
Erik Verdijk
Erik Verdijk 2018-4-7
关闭: MATLAB Answer Bot 2021-8-20
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 个评论

回答(1 个)

Walter Roberson
Walter Roberson 2018-4-9
mask = strcmp(raw(:,2), 'efg');
raw(mask, 3) = raw(mask, 4);

Community Treasure Hunt

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

Start Hunting!

Translated by