Invalid use of operator when trying to input function

5 views (last 30 days)
>> t = linspace(0,0.001);
>> v = 12-8*exp(-200000*t).+800000*t*exp(-200000*t);
v = 12-8*exp(-200000*t).+800000*t*exp(-200000*t);
Invalid use of operator.
>>
What am i doing wrong?

Answers (1)

KSSV
KSSV on 9 Jun 2022
Edited: KSSV on 9 Jun 2022
Read about MATLAB element by element operations.
t = linspace(0,0.001);
v = 12-8*exp(-200000*t)+800000*t.*exp(-200000*t);

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!