1. The problem statement, all variables and given/known data I have an equation that looks like func=sin(pi*x*n)*sin(pi*y*m) I was wondering if there was any method (possibly involving for loops) where I could get a plottable function along xy for all the different combinations of n and m i.e. m= 1 n =1 so the function would be sin(pi*x*1)*sin(pi*y*1) then m=1 n=2 sin(pi*x*1)*sin(pi*y*2) and so on... so basically it would create m*n equations 2. Relevant equations 3. The attempt at a solution i tried something like x=1:10; y=1:10; n=1:10; m=1;10; for i=1:length(x) for ii=1:length(n) for iii=1:length(y) for iiii=1:length(m) QQ(i)=sin(pi*x(i)*n(ii))*sin(pi*y(iii)*m(iiii)) end end end end but this i assume yields 10 values which correspond to when x y n m all equal the same values on the for loops. i.e. the first value is when x,y,n,m = 1 and the second value is when x,y,n,m = 2 etc.