Undefined function 'conv2' for input arguments of type 'sym'.
1 次查看(过去 30 天)
显示 更早的评论
im trying to implement the function in the attached image but i get an error at the convolution step saying "Undefined function 'conv2' for input arguments of type 'sym'."
and my code as follows :
if true
clc;
close all;
M=8;
N=32;
K=14;
c=2;
p=1;
i=13;
s=1;
syms pfa1 i T
eqn = (symsum(nchoosek(M,i)*(pfa1)^(i)*(1-pfa1)^(M-i), i, s, M)==10^(-6));
solve(eqn,pfa1);
result=solve(eqn,pfa1);
result=double(result);
result=result( result<1 & result>0 & abs(imag(result))<2*eps );
e=result
f_t=p^(c/2).*(c/2)*t.^((c/2)-1).*exp(-(t/p).^(c/2))
F_t=1-exp(-(t/p).^(c/2));
fk_t=K*nchoosek(N/2,K).*(1-F_t).^(N/2-K).*(F_t).^(K-1).*f_t
Fk_t=symsum(nchoosek(N/2,i).*(1-F_t).^(N/2-i).*(F_t).^(i), i, K, N/2)
%fz_t=2.*fk_t.*Fk_t
fz_t=conv(fk_t,fk_t)
q=fz_t.* exp(-(T*t/p).^(c/2))
fun = @(t) q
o=integral(q,0 ,Inf)
%eqn=q==e;
%T=solve(eqn, T,'Real',true)
end
0 个评论
采纳的回答
John D'Errico
2017-6-16
But conv2 is not defined for symbolic input. It was not written for that purpose. Just wanting software to do what you want is rarely going to work. I suppose that is one reason why they have documentation. :)
A convolution is just an integral. You will need to write as such, although the desired integral may or may not have a symbolic solution.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Calculus 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!