Replacing the values
조회 수: 1 (최근 30일)
이전 댓글 표시
I have a matrix of 100x62 ,the min and maximum values are
,0.2 and .9 respectively ,now i want all these values to be replaced by "DBLCL",PLEASE HELP
댓글 수: 1
Image Analyst
2012년 1월 29일
If your matrix is numerical, you can only have numbers in it, not some string like "DBLCL"
채택된 답변
Image Analyst
2012년 1월 29일
If DBLCL is a variable that has a number in it, you can do something like this:
m = rand(11,10); % Sample data.
% Find indexes matching the replacement criteria.
indexes = m > 0.2 & m < 0.9;
% Do the replacement.
m(indexes) = 99 % Or whatever other number you want.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Cell Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!