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

5 visualizzazioni (ultimi 30 giorni)
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.)

Risposta accettata

Torsten
Torsten il 27 Gen 2023
Spostato: Torsten il 27 Gen 2023
Elementwise operations are .* ./ and .^
.) does not exist.
f = (x.^2).*exp(-x)

Più risposte (0)

Categorie

Scopri di più su Get Started with MATLAB in Help Center e File Exchange

Tag

Prodotti


Release

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by