フィルターのクリア

Conversion to double from sym is not possible.

3 ビュー (過去 30 日間)
Nabhdeep Bansal
Nabhdeep Bansal 2014 年 9 月 6 日
編集済み: Andrei Bobrov 2014 年 9 月 11 日
syms t
td=5;
p0=3;
m=5;
w=4;
k=m*w^2;
t1=0:1:10;
for n = 1 : length(t1)
if t1(n)< td;
y(n) = p0*(t1(n)/td);
else
y(n) = p0;
end
end
x=int(y.*sin(w*(t-t1))/(m*w),0,t);
plot(t,x);
??? Error using ==> plot
Conversion to double from sym is not
possible.
Error in ==> Untitled2 at 16
plot(t,x);

回答 (1 件)

Andrei Bobrov
Andrei Bobrov 2014 年 9 月 11 日
編集済み: Andrei Bobrov 2014 年 9 月 11 日
td = 5;
p0 = 3;
m = 5;
w = 4;
x = @(z)arrayfun(@(t)integral(@(t1)p0*min(t1,td)/td.*sin(w*(t-t1)),0,t)/m/w,z);
plot(0:.01:20,x(0:.01:20));

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by