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

5 vues (au cours des 30 derniers jours)
Connor
Connor le 27 Jan 2023
Commenté : Connor le 27 Jan 2023
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.)

Réponse acceptée

Torsten
Torsten le 27 Jan 2023
Déplacé(e) : Torsten le 27 Jan 2023
Elementwise operations are .* ./ and .^
.) does not exist.
f = (x.^2).*exp(-x)

Plus de réponses (0)

Catégories

En savoir plus sur Get Started with MATLAB dans Help Center et File Exchange

Tags

Produits


Version

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by