How to write a system on nonlinear equations?

Forgive me if this has already been asked, but I'm trying to find out how to write a system on nonlinear equations as a function in MATLAB
for example:
a*(x(i))^2 + x(i-1) - x(i) = 0
How would I write this for any given size of x without writing the equations manually?
Would it be something like the following:
function y = myFunction(x)
y = a*(x(i))^2 + x(i-1) - x(i)
end

Antworten (1)

Shadaab Siddiqie
Shadaab Siddiqie am 18 Nov. 2020

0 Stimmen

From my understanding you want to solve nonlinear equations. You can refer fsolve for more information.

Diese Frage ist geschlossen.

Produkte

Version

R2020b

Gefragt:

am 11 Nov. 2020

Geschlossen:

am 20 Aug. 2021

Community Treasure Hunt

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

Start Hunting!

Translated by