Having trouble plotting function

>> 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일

1 개 추천

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)

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

제품

릴리스

R2021b

질문:

2022년 6월 9일

답변:

2022년 6월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by