作业帮 > 综合 > 作业

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

来源:学生作业帮 编辑:百度作业网作业帮 分类:综合作业 时间:2024/05/24 21:44:11
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);
嗯 求教哪里不对啊
MATLAB中如何判断一个矩阵中的元素是不是等于某一值
size(double(S))
ans =
1 531
>> size(i+96)
ans =
1 26
两个阵的维数不相等,不能用==来比较
你能再说的详细点不?程序要达到什么目的