How to replace the matching cell
Mostrar comentarios más antiguos
Hi,
I have the below cell matrix,
pass OK Out OK OK Out
pass OK Out OK OK Out
fail OK Out OK OK Out
pass OK Out OK OK Out
pass OK Out OK OK Out
fail OK Out OK OK Out
If in first column of particular row is "fail" then replace the Out as "Outspec". Kindly someone help how to do this.
4 comentarios
Stephen23
el 8 de Ag. de 2016
@Mekala balaji: please show us the desired output as well.
Mekala balaji
el 8 de Ag. de 2016
Your input and output arrays do not match, according to your description: your output has "Out" in position (4,5), but the input does not. Where does this "Out" come from ?
Also in columns four and five you have three "OutSpec", but your input array does not show any "Out"s in those columns, as they both contain only "OK"s, and you did not mention that you want to do anything with "OK". Where did these "OutSpecs"s come from?
Mekala balaji
el 9 de Ag. de 2016
Editada: Walter Roberson
el 9 de Ag. de 2016
Respuesta aceptada
Más respuestas (1)
Walter Roberson
el 6 de Ag. de 2016
mask = strcmp(YourCell(:,1), 'fail');
YourCell(mask,[3 6]) = {'Outspec'};
3 comentarios
Mekala balaji
el 6 de Ag. de 2016
Walter Roberson
el 6 de Ag. de 2016
The entire row is not changed. Only columns 3 and 6 are changed. Did you try the code?
Mekala balaji
el 8 de Ag. de 2016
Categorías
Más información sobre Noncentral t Distribution 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!