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!