How to replace the matching cell
古いコメントを表示
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 件のコメント
Stephen23
2016 年 8 月 8 日
@Mekala balaji: please show us the desired output as well.
Mekala balaji
2016 年 8 月 8 日
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
2016 年 8 月 9 日
編集済み: Walter Roberson
2016 年 8 月 9 日
採用された回答
その他の回答 (1 件)
Walter Roberson
2016 年 8 月 6 日
mask = strcmp(YourCell(:,1), 'fail');
YourCell(mask,[3 6]) = {'Outspec'};
3 件のコメント
Mekala balaji
2016 年 8 月 6 日
Walter Roberson
2016 年 8 月 6 日
The entire row is not changed. Only columns 3 and 6 are changed. Did you try the code?
Mekala balaji
2016 年 8 月 8 日
カテゴリ
ヘルプ センター および File Exchange で Noncentral t Distribution についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!