Invalid use of operator. error, dont know what to change to fix it.

5 views (last 30 days)
The function I have to plug into is
I keep getting the error:
File: solution.m Line: 5 Column: 22
Invalid use of operator.
(Line: 5 is f =)
Im not sure what to change to fix the error.
x = linspace(0,5,1000);
f = (x.*x)*exp(-x.)

Accepted Answer

Torsten
Torsten on 27 Jan 2023
Moved: Torsten on 27 Jan 2023
Elementwise operations are .* ./ and .^
.) does not exist.
f = (x.^2).*exp(-x)

More Answers (0)

Categories

Find more on Get Started with MATLAB in Help Center and File Exchange

Tags

Products


Release

R2022b

Community Treasure Hunt

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

Start Hunting!