How to write this?

4 visualizaciones (últimos 30 días)
MARÍA DEL MAR MARTÍNEZ MERCADER
MARÍA DEL MAR MARTÍNEZ MERCADER el 17 de En. de 2021
Editada: Rik el 17 de En. de 2021
f(x)=(x1-1)^2+(x2-1)^2

Respuestas (1)

Rik
Rik el 17 de En. de 2021
Editada: Rik el 17 de En. de 2021
To answer your question:
f(x)=(x1-1)^2+(x2-1)^2
To answer the question you meant to ask:
f=@(x1,x2) (x1-1).^2+(x2-1).^2;
Depending on what you want to do that might be the correct form.
If not, I suggest you do a basic Matlab tutorial (like e.g. Onramp) or take a look here for advice on how to improve your question.

Categorías

Más información sobre Chemistry en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by