Hi Pasquale,
Dato che non conosco l'italiano, risponderò alla tua domanda in inglese. Ci scusiamo per l'inconveniente.
It seems like you are encountering an error because the variable "x" is not defined when you call the function "f". To resolve this issue, you need to define "x" before calling the function. Make sure that the function "f" is saved in a file named "f.m" in your current working directory or in a directory that is on your MATLAB path.
% Save this part as f.m
function [y] = f(x)
y(1) = x(1)^2 + 2*x(1)*x(2) - x(3);
y(2) = x(2)^3 + x(3)^2;
y(3) = x(2)*x(3) - 1;
y = y';
end
% Script to call the function
% Define the vector x
x = [1; 1; 1]; % Example initial values for x
% Call the function f
[y] = f(x);
% Display the result
disp(y);
Make sure to adjust the initial values of x as needed for your specific problem.
You can take a look at this documentation for more info: https://www.mathworks.com/help/matlab/ref/function.html