Replacing the values

조회 수: 1 (최근 30일)
kash
kash 2012년 1월 29일
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
Image Analyst 2012년 1월 29일
If your matrix is numerical, you can only have numbers in it, not some string like "DBLCL"

댓글을 달려면 로그인하십시오.

채택된 답변

Image Analyst
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개)

카테고리

Help CenterFile Exchange에서 Cell Arrays에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by