clear;clc;syms x y;a=0.89;b=0.6;t=0.07168;c=2*a/b;h0=0.01:0.01:0.14;[m,n]=size(h0);for i=mfor j=ns(i,j)=int(int(c*sqrt(b^2-y^2),y,-b,-t*x+h0(i,j)-b),x,-0.4,h0(i,j)/t);L(i,j)=vpa(s(i,j))*1000;endend为什么总是输出最后一个值,但是前面的

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/15 11:14:03

clear;clc;syms x y;a=0.89;b=0.6;t=0.07168;c=2*a/b;h0=0.01:0.01:0.14;[m,n]=size(h0);for i=mfor j=ns(i,j)=int(int(c*sqrt(b^2-y^2),y,-b,-t*x+h0(i,j)-b),x,-0.4,h0(i,j)/t);L(i,j)=vpa(s(i,j))*1000;endend为什么总是输出最后一个值,但是前面的
clear;
clc;
syms x y;
a=0.89;b=0.6;
t=0.07168;
c=2*a/b;
h0=0.01:0.01:0.14;
[m,n]=size(h0);
for i=m
for j=n
s(i,j)=int(int(c*sqrt(b^2-y^2),y,-b,-t*x+h0(i,j)-b),x,-0.4,h0(i,j)/t);
L(i,j)=vpa(s(i,j))*1000;
end
end
为什么总是输出最后一个值,但是前面的值都是0?

clear;clc;syms x y;a=0.89;b=0.6;t=0.07168;c=2*a/b;h0=0.01:0.01:0.14;[m,n]=size(h0);for i=mfor j=ns(i,j)=int(int(c*sqrt(b^2-y^2),y,-b,-t*x+h0(i,j)-b),x,-0.4,h0(i,j)/t);L(i,j)=vpa(s(i,j))*1000;endend为什么总是输出最后一个值,但是前面的
for i=m
for j=n
这算是什么语句呢,
应该是这样吧,并且,你的m本身就是1,完全可以不要,直接for j 开始
for i=1:m
for j=1:n

把这两句改了就好了,
我已在matlab得出结果
你试试吧

matlAB中这个程序错在那啊clc;clear; syms x y;>> iy=int((1-(x^2+y^2)^(1/2)),y,-sqrt(1-x^2),sqrt(1-x^2));>> int(iy,x,-inf,inf) MATLAB中将场数改为字母后,clc;clear;syms x y r ;a=[];eq12=sqrt((x+2).^2+y.^2)-sqrt(x.^2+(y-2*sqrt(3)).^2 )-2*r;eq13=sqrt((x+2).^2+y.^2)-sqrt((x-2).^2+y.^2)-2*r;d2=solve(eq12,eq13);a(2,1)=double(d2.x);a(2,2)=double(d2.y);之前把r换成一个 matlab解非线性方程组结果带有未知数clc,clear;a=6378136.5;b=6356751.8;h=42164000;k=tan(140/10^6);syms x y;m=-k*x+h-y;n=x^2/a^2+y^2/b^2-1;[x,y]=solve(m,n)为什么求出的x,y中还有未知数啊,请高手给出一个正确的解法其实 matlab 最速下降法求解clc;clear;disp('最速下降法')syms x1 x2 lam;x=[x1 x2];t=0; X0=[1;1]; y=(x1^2+x2-11)^2+(x1+x2^2-7)^2;e=0.01;for n=1:10 a=subs(diff(y,x1),x,X0); b=subs(diff(y,x2),x,X0); yj=[a;b]; z=subs(y,x,X0-lam*y clear;clc;syms x y;a=0.89;b=0.6;t=0.07168;c=2*a/b;h0=0.01:0.01:0.14;[m,n]=size(h0);for i=mfor j=ns(i,j)=int(int(c*sqrt(b^2-y^2),y,-b,-t*x+h0(i,j)-b),x,-0.4,h0(i,j)/t);L(i,j)=vpa(s(i,j))*1000;endend为什么总是输出最后一个值,但是前面的 matlab画曲面,大家帮我看看哪里错了?clear;clc;syms x y z;[x y z] = meshgrid(0:0.02:1,0:0.02:1,0:0.02:1);ezmesh(x,0.2/x,z);axis tight我想画出空间曲面y=0.2/x,x,y,z的范围是(0,1),可是matlab总是提示错误,怎么修改就 matlab画图,感觉画出的有问题!帮忙改或者直接给代码!半立方抛物线:clear all;clc;a=1/10;x=0:pi/50:2*pi;y=sqrt(a.*(x.^3));polar(x,y);笛卡儿叶形线:clear all;clc;a=1;t=0:pi/100:2*pi;x=(3.*a.*t)/(1+t.^3);y=(3.*a.*t.^2)/ (1+ 还是matlab画图问题,要输入一个变量的clc; clear all; h=input('h=');y=zeros(1,30000);r=zeros(1,30000);for i=1:30000r(i) = unifrnd(0,1);y(i)=h*tan(pi*(r(i)-0.5));end;x=y(y>-30&y Untitled at 2syms h x画不出来图啊 matlab 错误! 问题是 符号函数隐函数 的 solve 求解.急寻高手解答!程序: clc clear syms m n; x=[m^2, n^2, 2*m*n] y=[n^2, m^2, 2*m*n] for i=1:3 ftest(i)=2*x(i)-y(i)-exp(-x(i)); ms(i)=solve('ftest=1','m'); end ftest ms 错误提示 下面这语句错在哪里?clc;clear; syms c1 c2 xfor c1=(1+eps):.1:2;for c2=0:.1:1;k=2;M=[c1 c2];y=k*x^(c1-1)-(1-x)^(c2-1);xx=solve(y,x);for i=1:1:length(xx);g=(c1-1)*k*xx(i)^(c1-2)-(c2-1)*(1-xx(i))^(c2-2);aa=solve(g,xx(i)); %matlab说这里有问 matlab int积分太慢,积不出来,怎么办?clear clc syms x format long H=[0:0.01:1.2]; v=pi*4.1/180;a=0.4;b=2.05;n=1.2;m=1.78; for i=1:15 h=H(i); S2=(pi/2+(h+(a-x)*tan(v)-n/2)/n*2.*sqrt(1-((h+(a-x)*tan(v)-n/2)/n*2).^2)+asin((h+(a-x)*tan(v)-n/2)/n 用Matlab求解定积分作图时出现Explicit integral could not be found这样一个数 想用matlab画出Φ与e的坐标图,横坐标是e,纵坐标是Φ,Io=1,r=0.01,具体编的程序是:clc;clear all;i=1;r=0.01;e=0:0.01:2;syms x y;y=1/4*i*int matlab仿真老是出现错误,请问怎么改?clear;clc;deta=2;w=2.5;theta=0;a=linspace(-10,10,25);b=linspace(-1.0,1.0,25);[x,y]=meshgrid(a,b);s(x,y)=exp(-0.5*((x/deta)^2+(y/deta)^2)).*sin(w*(x*cos(theta)+y*sin(theta)));plot3(x,y,s(x,y)); Subscript matlab switch case 不太会用,程序一直有错.clc;clear;x=0:0.1*pi:2*pi;a=input('name:')switch acase 'sin'y=sin(x);plot(x,y)case 'cos'y=cos(x);plot(x,y)case 'tan'y=tan(x);plot(x,y)otherwisebreak;end matlab中 内部矩阵维度问题源程序为clc;clear; x=[100110120130140.1150160.1170180190.2200210.1220230240250260270280290300310320330340350360369.9380390400]; y=[1.531.551.571.591.591.611.61.61.61.591.581.441.421.41.381.361.341.311.281.261.231 matlab解方程老出现is not a valid expression or equation.clear;clc;clf;syms x K R L D T Iref E a tao;K=0.3;R=10;L=12e-3;D=0.4;Iref=5;T=1e-4;E=350;a=E/R;tao=L/R;x=solve('(x-a)*exp(-T/tao)+2*a*exp((-T/tao)*(1-D-K*(Iref-x)))-a-x=0','x')出现错误 用matlab进行非线性拟合 nlinfit函数有组数据x=[1.1389 1.0622 0.9822 0.934 0.9251 0.9158]; y=[0.03 1 5.03 15.05 19.97 30.3]; 拟合函数为y=-k*ln(x+a)-b;我的拟合程序是clc;clear; x=[1.1389 1.0622 0.9822 0.934 0.9251 0.9158]; y=[0 matlab 未定义与 'char' 类型的输入参数相对应的函数 'int'.clc;clear;result=zeros(121);syms x;result(1)=int('5430*(0.5*sin(40*tan(4.1)-x*tan(4.1)-60)+40*tan(4.1)-x*tan(4.1)-60)-5430*(0.5*sin(-60)-60)','x','0','40');运行时报错:未