matlab程序优化figure[x,y,z] = sphere;a=surf(x,y,z);% sphere centered at originhold onfor i=1:32for j=1:32a(i,j)=surf(x+2*j,y,z+2*i,c); % sphere centered at (3,-2,0)set(a(i,j),'EdgeColor','g','FaceColor','g')endendwhitebg('w')daspect([1 1 1])这

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/13 02:06:59

matlab程序优化figure[x,y,z] = sphere;a=surf(x,y,z);% sphere centered at originhold onfor i=1:32for j=1:32a(i,j)=surf(x+2*j,y,z+2*i,c); % sphere centered at (3,-2,0)set(a(i,j),'EdgeColor','g','FaceColor','g')endendwhitebg('w')daspect([1 1 1])这
matlab程序优化
figure
[x,y,z] = sphere;
a=surf(x,y,z);% sphere centered at origin
hold on
for i=1:32
for j=1:32
a(i,j)=surf(x+2*j,y,z+2*i,c);
% sphere centered at (3,-2,0)
set(a(i,j),'EdgeColor','g','FaceColor','g')
end
end
whitebg('w')
daspect([1 1 1])
这个是用来在一个面上画密密麻麻的球体,但是速度过慢了,希望有大神来优化一下这个程序

matlab程序优化figure[x,y,z] = sphere;a=surf(x,y,z);% sphere centered at originhold onfor i=1:32for j=1:32a(i,j)=surf(x+2*j,y,z+2*i,c); % sphere centered at (3,-2,0)set(a(i,j),'EdgeColor','g','FaceColor','g')endendwhitebg('w')daspect([1 1 1])这
把 for 去掉.c++里面 for 运算 非常快捷.但是 matlab里面 for的运算速度会非常慢.你这里还两重for.

matlab程序优化figure[x,y,z] = sphere;a=surf(x,y,z);% sphere centered at originhold onfor i=1:32for j=1:32a(i,j)=surf(x+2*j,y,z+2*i,c); % sphere centered at (3,-2,0)set(a(i,j),'EdgeColor','g','FaceColor','g')endendwhitebg('w')daspect([1 1 1])这 matlab 问题? Error using ==> initial at 71 Not enough input arguments.在运行程序:%标准粒群优化算法程序%测试函数:f(x,y)=100(x^2-y)^2+(1-x)^2, -2.048 你能不能给我解释一下你这个matlab程序啊?我刚提问了个问题,你去回答我给你加分~close all;clear all;clc;x=zeros(100,100);x(1:50,1:50)=1;x(51:100,51:100)=1;figure;imshow(x);y=repmat(x,5,5);figure;imshow(y);z = imrotate(y,30 matlab程序中plot(t,y(:,1))意思如下程序 帮忙释义一下 谢谢了figure(1);plot(T,Y(:,1),'-k');figure(2)plot(Y(end-2000:end,1),Y(end-2000:end,2),'-k'); 粒子群优化算法(PSO)的matlab运行程序~ 用matlab遗传算法解决函数优化问题上机编写程序,解决函数优化问题.考虑一元函数求最大值的优化问题f(x)=x*sin(10pi*x) +2 -2 matlab优化 用Matlab解最优化问题.将两个设计参数x和y定为0 matlab最优化问题两个设计参数x和y,1 matlab中?Subscripted assignment dimension mismatch.程序在这里,figure[x,y,z]=meshgrid(linspace(0,100)); %做出网格meshgridfor i=1:2p(i,:)=0.00513.*(-0.00000244*((x-20-9.8.*(i-1)).^2+(y-25).^2).^3+0.00104*((x-20-9.8.*(i-1)).^2+(y-25).^2).^2-0. matlab 最优化我对matlab不太了解,有一个简单的问题如下:求f=x^3+y^4,在x^2+y^2==1的条件下的最大值.请高手给出程序.另外,orth(A)返回的不是对A做schmidt正交化得到的那组基底吧? matlab 非线性最优化我对matlab不太了解,有一个简单的问题如下:求f=x^3+y^4,在x^2+y^2==1的条件下的最大值.请高手给出程序,谢谢!用fmincon怎么写呢? matlab优化约束matlab优化的约束,有等式约束,不等式约束;x+8 帮忙解答一下MATLAB直方图规定化程序I=imread('girl.jpg');J=histeq(I,32);[counts,x]=imhist(J);Q=imread('girl.jpg');figure;imshow(Q);A=rgb2gray(Q); figure;imhist(A);M=histeq(A,counts);figure;imshow(M);figure;imhist(M);求解大概的意思 紧急,谁知道这个matlab优化程序错在哪里了?function y=myfunction(x);y=0.785398*(4.75*x(1)*x(2)^2*x(3)^2+85*x(1)*x(2)*x(3)^2-85*x(1)*x(3)^2+0.92*x(1)*x(6)^2-x(1)*x(5)^2+0.8*x(1)*x(2)*x(3)*x(6)-1.6*x(1)*x(3)*x(6)+x(4)*x(5)^2+x(4)*x(6)^2+28 一个matlab的画图程序,怎么将for循环去掉,提高运行速度clc;clear;x=0:0.01:0.99;y=0:0.01:0.99;figure(1)hold onfor i=1:50for j=1:100if y(j) matlab程序中figure('pos',[50,50,200,150],'color',pos color matlab中figure是什么意思