下标索引必须为正整数类型或逻辑类型。

13 views (last 30 days)
方程和应该得到的图
我的编程和反馈图如下:t = 0:0.01:2*pi;
f(t) = 5 + 8/pi*sin((pi/10)*t);
g(t) = 5 + 8/(3*pi)*sin((3*pi/10)*t);
z(t) = 5 + 8/(5*pi)*sin((5*pi/10)*t);
figure
plot(t,f(t),t,g(t),t,z(t))
y(t) = f(t)+g(t)+z(t);
plot(t,y(t))
问题:一直显示下标索引必须为正整数类型或逻辑类型。

Accepted Answer

新盛公司注册登录网址【hn666.cc】
参考代码:
clear;clc
t = 0:0.01:2*pi;
f = 5 + 8/pi*sin((pi/10)*t);
g = 5 + 8/(3*pi)*sin((3*pi/10)*t);
z = 5 + 8/(5*pi)*sin((5*pi/10)*t);
figure
plot(t,f,t,g,t,z)
y = f+g+z;
hold on
plot(t,y)

More Answers (0)

Categories

Find more on 数学 in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!