MATLAB中如何判断一个矩阵中的元素是不是等于某一值

问题描述:

MATLAB中如何判断一个矩阵中的元素是不是等于某一值
S='Scientists look for universal patterns of complex systems because such invariant features may help to unveil the principles of system organization.Complex network studies can not only provide a unique viewpoint of nature and society but also reveal ubiquitous patterns,e.g.,small world and scale free,characteristic of various complex systems.However,ecological studies have shown that binary food webs,which depict trophic interactions in ecosystems,refuse to become part of the small world and scale free networks family.'; %这样一个字符串
i=1:26;
output=char(i+96)
A=find(double(S)==i+96); %找到其中为A的元素
S(A) %输出
额.系统报错 说
Error using ==
Matrix dimensions must agree.
Error in mart (line 4)
A=find(double(S)==i+96);
嗯 求教哪里不对啊
1个回答 分类:综合 2014-11-11

问题解答:

我来补答
size(double(S))
ans =
1 531
>> size(i+96)
ans =
1 26
两个阵的维数不相等,不能用==来比较
你能再说的详细点不?程序要达到什么目的
 
 
展开全文阅读
剩余:2000
下一页:绘图