syms T
h=1.054*(10^-34);
T=[1:20:1001];
kb=1.38*(10^-23);
g=1.1;
vd=6703.3;
M=4.6637*(10^-26);
td=355.33;
A=(h*(g^2)*(kb^2))/(M*(vd^2)*td*(h^2));
c=((kb^4).*(T.^3))/(2*(pi^2)*vd*(h^3));
g1=2*(10^-4);
V=2.0024*(10^-29);
syms x xd
syms ru(x) ru1(x) ru2(x) f(x) f1(x) q kc
ru(x)=(1./(A.*exp(-td./(3.*T)).*(T.^3)*(x^2)));
ru1(x)=(4*pi*(vd^3)*(h^4))./(g1*V*(kb^4)*(T.^4)*(x^4));
ru2=ru+ru1;
f(x)=((x^2)*exp(x))/((exp(x)-1)^2);
f1=ru2*f;
k=matlabFunction(f1);
xd=td./T ;
q=0;
kc=0;
for i=1:1:length(xd)
q(i)=integral(k,0,xd(i),'ArrayValued',true);
kc(i)=c(i).*q(i)
end
I'm getting the following error
In an assignment A(:) = B, the number of elements in A and B must be the same.
Error in hw4 (line 26)
q(i)=integral(k,0,xd(i),'ArrayValued',true);
2 件のコメント
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/365417-how-can-i-solve-the-error-in-the-code-given-below-i-m-getting-the-following-error-in-an-assignment#comment_501775
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/365417-how-can-i-solve-the-error-in-the-code-given-below-i-m-getting-the-following-error-in-an-assignment#comment_501775
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/365417-how-can-i-solve-the-error-in-the-code-given-below-i-m-getting-the-following-error-in-an-assignment#comment_501803
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/365417-how-can-i-solve-the-error-in-the-code-given-below-i-m-getting-the-following-error-in-an-assignment#comment_501803
サインインしてコメントする。