How to write this?
Show older comments
Answers (1)
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.
Categories
Find more on Creating, Deleting, and Querying Graphics Objects in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!