1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Matlab: creating a table of equations using multiple variables

  1. Oct 22, 2012 #1
    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
    then m=1 n=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
    for i=1:length(x)
    for ii=1:length(n)
    for iii=1:length(y)
    for iiii=1:length(m)

    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.
  2. jcsd
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?
Draft saved Draft deleted