Conversion to double from sym is not possible
이전 댓글 표시
Hi every body,
this is my code
syms t
x=-3:.1:3;
for i=1:length(x);
Pin=3*exp(-t^2);
z=x(i);
Eo(i)=int(Pin,t,-inf,z);
Ein(i)=int(Pin,t,-inf,inf);
E(i)=Eo(i)/Ein(i);
Go=1000;
G(i)=Go/(Go-(Go-1)*exp(-E(i)*0.1));
Bc=3;
Dv(i)=-(Bc*Pin/(4*pi*10*Ein(i)))*(G(i)-1);
end
plot(x,Dv,'-r*')
when I come to plot, I get this message
Conversion to double from sym is not possible
help me please, have a nice life
댓글 수: 1
Andrei Bobrov
2011년 10월 12일
Pin use in last row, so Pin(x)?
채택된 답변
추가 답변 (1개)
Walter Roberson
2011년 10월 12일
Try
Dv(i) = double( -(Bc*Pin/(4*pi*10*Ein(i)))*(G(i)-1) );
카테고리
도움말 센터 및 File Exchange에서 Operations on Strings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!