帮忙改个matlab的程序a=ones(8);a(1,2)=3;a(1,3)=4;a(1,4)=5;a(1,5)=6;a(1,6)=7;a(1,7)=8;a(1,8)=9;a(2,3)=3;a(2,4)=4;a(2,5)=5;a(2,6)=6;a(2,7)=7;a(2,8)=8;a(3,4)=3;a(3,5)=4;a(3,6)=5;a(3,7)=6;a(3,8)=7;a(4,5)=3;a(4,6)=4;a(4,7)=5;a(4,8)=6;a(5,6)=3;a(5,7)

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/16 12:47:23
帮忙改个matlab的程序a=ones(8);a(1,2)=3;a(1,3)=4;a(1,4)=5;a(1,5)=6;a(1,6)=7;a(1,7)=8;a(1,8)=9;a(2,3)=3;a(2,4

帮忙改个matlab的程序a=ones(8);a(1,2)=3;a(1,3)=4;a(1,4)=5;a(1,5)=6;a(1,6)=7;a(1,7)=8;a(1,8)=9;a(2,3)=3;a(2,4)=4;a(2,5)=5;a(2,6)=6;a(2,7)=7;a(2,8)=8;a(3,4)=3;a(3,5)=4;a(3,6)=5;a(3,7)=6;a(3,8)=7;a(4,5)=3;a(4,6)=4;a(4,7)=5;a(4,8)=6;a(5,6)=3;a(5,7)
帮忙改个matlab的程序
a=ones(8);
a(1,2)=3;a(1,3)=4;a(1,4)=5;a(1,5)=6;a(1,6)=7;a(1,7)=8;a(1,8)=9;
a(2,3)=3;a(2,4)=4;a(2,5)=5;a(2,6)=6;a(2,7)=7;a(2,8)=8;
a(3,4)=3;a(3,5)=4;a(3,6)=5;a(3,7)=6;a(3,8)=7;
a(4,5)=3;a(4,6)=4;a(4,7)=5;a(4,8)=6;
a(5,6)=3;a(5,7)=4;a(5,8)=5;
a(6,7)=3;a(6,8)=4;
a(7,8)=3;
for j=1:8
c(j)=sum(a(:,j))/40;%求均值
z(j)=var(a(:,j));%求方差
end
for j=1:8
for i=1:40
x(i,j)=(a(i,j)-c(j))/sqrt(z(j));
end
end
f=cov(x);
[v,d]=eig(f);
h=0;g=0;
for m=1:8
g=g+d(m,m);
end
for n=1:8
if d(n,n)>1
h=h+d(n,n);
end
end
k=h/g;
F1=x*v(:,8);
F2=x*v(:,7);
F=d(8,8)/(d(8,8)+d(7,7))*F1+d(7,7)/(d(8,8)+d(7,7))*F2;
[y,q]=sort(F,'descend');
y'
q'
Warning:Divide by zero.
Warning:Divide by zero.
Warning:Divide by zero.
Warning:Divide by zero.
Warning:Divide by zero.
Warning:Divide by zero.
Warning:Divide by zero.
Warning:Divide by zero.
Index exceeds matrix dimensions.

帮忙改个matlab的程序a=ones(8);a(1,2)=3;a(1,3)=4;a(1,4)=5;a(1,5)=6;a(1,6)=7;a(1,7)=8;a(1,8)=9;a(2,3)=3;a(2,4)=4;a(2,5)=5;a(2,6)=6;a(2,7)=7;a(2,8)=8;a(3,4)=3;a(3,5)=4;a(3,6)=5;a(3,7)=6;a(3,8)=7;a(4,5)=3;a(4,6)=4;a(4,7)=5;a(4,8)=6;a(5,6)=3;a(5,7)
for i=1:40
x(i,j)=(a(i,j)-c(j))/sqrt(z(j));
end
你的i没有40个啊
而且你的z(1,:)=0

帮忙改个matlab的程序a=ones(8);a(1,2)=3;a(1,3)=4;a(1,4)=5;a(1,5)=6;a(1,6)=7;a(1,7)=8;a(1,8)=9;a(2,3)=3;a(2,4)=4;a(2,5)=5;a(2,6)=6;a(2,7)=7;a(2,8)=8;a(3,4)=3;a(3,5)=4;a(3,6)=5;a(3,7)=6;a(3,8)=7;a(4,5)=3;a(4,6)=4;a(4,7)=5;a(4,8)=6;a(5,6)=3;a(5,7) MATLAB 多元回归 t检验自变量是x1-x4,因变量y改了一点程序向用还是用不了,求大神看下.谁再能解释下程序的意思.z=[x1,x2,x3,x41,x42];y=A(:,1); % example[n,k]=size(z);X=[ones(n,1),z];%构建结构阵XB=X'*X; %求算信 matlab关于ones和sizes的问题>>j_n_N = n : N>>ones(1,size(j_n_N, 2)帮忙解释下,谢谢 matlab程序中U=ones(size(T)的含义我正在做倒立摆的课程设计 参考勒一段程序:% 求开环系统的阶跃响应并显示T = 0:0.005:5;U = 0.2*ones(size(T));[Y,X] = lsim(A,B,C,D,U,T);plot(T,Y)不知道其实 U = 0.2*ones(size(T)) matlab问题,这个程序,a是数组,那s=a(ceil(10*t+0.01)).*g.*cos(2*pi*100*t)是个什么运算?能解释一下这个程序更好,这是个幅度调制的程序,t=0:1/1e3:0.999;a=randint(1,10,2)g=ones(1,100);g=[g,g,g,g,g,g,g,g,g,g];s=a(ceil(10*t+0 在MATLAB中,我有几句程序看不懂,a1(:,1)=ones(33,1); a1(:,2:8)=A(:,1:7); b1=B(:,1); y11=aA和B分别为2个矩阵. MATLAB画功率谱密度的图形...N=[ones(1,500) ones(1,500) zeros(1,500) ones(1,500) zeros(1,500) ];N=2*N-1;figure(1)plot((1:2500)/2500,N );axis([0 1 -1.5 1.5]);Fx=10;t=0:1/2500:0.9996;signal=N.*cos(2*Fx*pi*t);以上是我的程序,求高手帮忙 matlab程序,麻烦帮我看下哪里有错以及怎么改%画等势线及电场线function f=draw(s)a=-2:0.1:2;b=a';a=ones(size(b))*a;b=b*ones(size(b))';z=subs(s,{x,y},{a,b});[dx,dy]=grandient(z);xx=[linspace(-2,2,10),2*linspace(1,1,10),linspace(-2, matlab中怎么定义元素相同的向量.比如1*27个1 A=ones[(1:1:27)] 怎么定义1行27列的2向量 hermite插值法和拉格朗日插值法的matlab程序实现请求高手帮忙给个hermite插值法和拉格朗日插值法的matlab程序,要求实现x=[-5.0000 -3.8889 -2.7778 -1.6667 -0.5556 0.5556 1.6667 2.7778 3.8889 5.0000];y=[0.0385 0.0620 0 matlab中的A=[x',y',ones(size(x'))]; matlab里怎么生成一个有很多相同元素的向量?比如向量里有100个0,然后是100个1,然后是50个2...以此类推噢我找到答案了,a=[ones(1,100)*0,ones(1,100),ones(1,50)*2] 大牛给解释一下这个层次分析法的matlab代码吧%层次分析法的matlab程序 disp('请输入判断矩阵A(n阶)');A=input('A=');[n,n]=size(A);x=ones(n,100);y=ones(n,100);m=zeros(1,100);m(1)=max(x(:,1));y(:,1)=x(:,1);x(:,2)=A*y(:,1);m(2 matlab编程问题:已编写好程序 function c=qr(n,tol) 现要计算输入变量n=2,4,6,8,...,100时qr(n,tol)的值function c=qr(n,tol)A=diag(-ones(n-1,1),-1)+diag(-ones(n-1,1),1)+diag(2*ones(n,1));k=1;A0=zeros(n);while norm(diag(A-A0))>tol,k=k+ matlab 程序中%标注的地方一直报错%2FSK仿真程序clear all;fs=2000; dt=1/fs;f1=20;f2=120; a=round(rand(1,10)); g1=a;g2= a; g11=(ones(1,2000))*g1; g1a=g11(:)’;g21=(ones(1,2000))’*g2;g2a=g21(:);t=0:dt:10-dt;t1=length(t);fsk1 =g1a.*cos(2 帮忙看看为什么这个程序用matlab 2007b可以出图形,2013a就显示空白呢、、、syms x y zf=x^2+y^4+z^3+2*y*z-5*sin(z)-4;clffor ii=-2:.2:2h=ezplot(subs(f,z,ii),[-3 3]);set(h,'zData',ii*ones(size(get(h,'xData'))));hold onendtitle([char 求高手帮忙写个简单的matlab的程序已知:a:b:c:d:e=12:3:1:4:1a+b+c+d+e=(需要输入的数)求,a,b,c,d,e的值.写出的程序效果:只要输入一个数,这个数就会按上述比例产生另外5个数. 状态反馈matlab中的一段程序,u2=[ones(m,n),ones(m,n)]'-K2*x2' u1=[ones(m,n),ones(m,n)]'-K1*x1'plot(t1,u1(1,:),'k',t1,u1(2,:),'k--')