How to plot a square surface in Matlab?
Matlab
More exactly I want to plot a square square with value 0.5 surface which is located at X:-1 to X=1 and Y:2.5 to 3.5.
This is what the patch function is for.
patch
Matlab documentation
so for your case:
X = [ -1 -1 1 1]; Y = [3.5 2.5 2.5 3.5]; Z = [0.5 0.5 0.5 0.5]; patch(X,Y,Z,'red') view(45,45)