Filter löschen
Filter löschen

I want to create a function that I can plot

1 Ansicht (letzte 30 Tage)
Asad Ahmed
Asad Ahmed am 11 Aug. 2021
Bearbeitet: the cyclist am 11 Aug. 2021
y1 = -10^(0.5.*x) + sin(x) * abs(x.^3 - 4.*x - 1);
Incorrect dimensions for raising a matrix to a power. Check that the matrix is square and the
power is a scalar. To perform elementwise matrix powers, use '.^'.
^ This is the error I am getting and I'm trying to fix it but I'm stuck.

Antworten (1)

the cyclist
the cyclist am 11 Aug. 2021
Bearbeitet: the cyclist am 11 Aug. 2021
You needed elementwise operations in several places that you did not use it:
x = 1:5;
y1 = -10.^(0.5.*x) + sin(x) .* abs(x.^3 - 4.*x - 1);
plot(x,y1)

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Tags

Produkte


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by