F21x和M21y的计算公式在附件中.下面是我自己编的程序,不知道对不对,而且有错误.希望大家帮我看看.麻烦了!
clear all;
global K Ce;
global t;
miu0=4*pi*(10.^-7);
n=20;
i0=2;
R=0.025;
r=0.0246;
l=0.02;
b=0.01;
e2=0.00015;
L=2.19;
alf=pi/4;
Kc=miu0*(n.^2)*(i0.^2)*R*L/8;
Ce2=e2/(R-r);
K=Kc/l*((R-r).^2);
A=zeros(8,2);
N=0;
sum=0;
syms z;
while N<=7
A(N+1,1)=(1+2*N)*pi/8-asin(b/(2*R));
A(N+1,2)=(1+2*N)*pi/8+asin(b/(2*R));
theta=[A(N+1,1):0.01:A(N+1,1)];
f1=-K*z*(sin(theta)./((1-z*Ce2*cos(alf-theta)/L).^2));
f2=inline('f1','theta','z');
f3=quad(f2,A(N+1,1),A(N+1,2),-l/2,l/2)
N=N+1;
sum=sum+f3;
end
theta=[A(1,1):0.01:A(1,2),A(2,1):0.01:A(2,2),A(3,1):0.01:A(3,2),...
A(4,1):0.01:A(4,2),A(5,1):0.01:A(5,2),A(6,1):0.01:A(6,2),...
A(7,1):0.01:A(7,2),A(8,1):0.01:A(8,2)];
M21x=sum;
bar(theta,M21x)
这个程序执行完了之后,总用这样的错误
??? Error using ==> inline/feval
Not enough inputs to inline function.
Error in ==> D:\MATLAB6p5\toolbox\matlab\funfun\quad.m
On line 59 ==> y = feval(f, x, varargin{:}); |