Having trouble plotting function

7 次查看(过去 30 天)
Joshua Cabral
Joshua Cabral 2022-6-9
回答: KSSV 2022-6-9
>> t = linspace(0,0.001,1);
>> i = 0.015+exp(-10000*t)(-0.01*cos(20000*t)-0.0025*sin(20000*t));
Error: Invalid array indexing.
New to MATLAB, trying to plot a graph but function gets interpreted as array.

回答(1 个)

KSSV
KSSV 2022-6-9
t = linspace(0,0.001);
F = 0.015+exp(-10000*t).*(-0.01*cos(20000*t)-0.0025*sin(20000*t)); %<-- you missed .*
plot(t,F)

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by