I'm somewhat new to MATLAB and I'm trying to make a large matrix structured very much like the following example:
C=[1,2,3]
n=[-3,0,3]
X=[f(1,-3),f(1,0),f(1,3);f(2,-3),f(2,0),f(2,3);f(3,-3),f(3,0),f(3,3)]
where f is some function of the values in C and n. I need this sort of matrix, X, so that I can make a surface graph of surf(C,n,X). The issue is that, in my real problem, I need a 51x51 matrix, and I don't know how to make such a matrix without typing out everything (which would be a horrific task).
Could someone please help me understand how to make such a plot? Thank you so much!
foperate element-wise on array inputs as well as just a pair of scalars (e.g.f(1,1)) as you have shown?