MATLAB: Graph f(x,y) function

cloud setFuzzy Logic ToolboxgraphMATLABMATLAB Production Servernebulous logic

Hello! I have to graph a problem in Nebulous Logic with Matlab. I am rusty on my commands (never used Matlab before, so i'm not sure which one command to use. I am trying to make a function f(x,y)=-(x-10)^2-(y-10)^2. I need consideer a interval of [-10,10] and construct five fuzzy sets (C1,C2,C3,C4,C5) for eachone. Can somebody give-me a help ? i'm dying trying here T-T I need to use the fuzzy logic toolbox to solve this problem

Best Answer

I have no idea what a ‘cloud set’ is, although creating the function (here as an anonymous funciton) is straightforward:
f = @(x,y) -(x-10).^2 -(y-10).^2;
[X,Y] = meshgrid(-10:10);
figure(1)
meshc(X, Y, f(X,Y))
grid on
See the documentation on Function Basics (link) for the details on creating and using functions.
I added the plot for fun, and to demonstrate how to call the function.
Related Question