Undefined function 'conv2' for input arguments of type 'sym'.
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Fatma Abdullah
le 16 Juin 2017
Réponse apportée : John D'Errico
le 16 Juin 2017
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 commentaires
Réponse acceptée
John D'Errico
le 16 Juin 2017
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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Calculus dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!