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