I am trying to construct a matrix (or a grid) with specific limits on the x and y axes from two vectors:
ns = 20;
np = 20;
S = linspace(0,1,ns);
P = linspace(-1,1,np);
The resulting grid I want has the follwoing shape (just for an illustrative purpose. Surely the number of points would be larger):
I have thought about "meshgrid(S,P)" command, but it won't help as it doesn't let me have the specific P limits that I want, as shown in the photo above.
Any help would be appreicated!