Having trouble plotting function

7 visualizzazioni (ultimi 30 giorni)
Joshua Cabral
Joshua Cabral il 9 Giu 2022
Risposto: KSSV il 9 Giu 2022
>> 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.

Risposte (1)

KSSV
KSSV il 9 Giu 2022
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)

Prodotti


Release

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by