如何用内建函数代替下列matlab代码中的for循环? 50
fori=1:mforj=1:na(i,j)=min(r(i,j),g(i,j));a(i,j)=min(a(i,j),b(i,j));endend...
for i = 1:m
for j = 1:n
a(i,j) = min(r(i,j),g(i,j));
a(i,j) = min(a(i,j),b(i,j));
end
end 展开
for j = 1:n
a(i,j) = min(r(i,j),g(i,j));
a(i,j) = min(a(i,j),b(i,j));
end
end 展开
2个回答
2016-06-22
展开全部
m=cell(20,5)fora=0.7;0.1:2forb=0.1:0.1:0.8forz=0.1:0.1:0.7forx=8:2:20f=0,fn=0forn=1:(x/2-1)f=1000./(x/2-1).*(0.7-z)./((z-0.7).*(sqrt(a^2-b^2-4.*a.*sqrt(0.16-b^2/4)-1.32)./1.96)-(sqrt(0.16-b^2/4))+(sqrt(0.16-(n.*b./x)^2)))fn=fn+fendiffn==0i=i+1m{i,1}=a;%m,不是cellm{i,2}=b;m{i,3}=z;m{i,4}=x;m{i,5}=fn;endendendendendm
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询