I want to make a 2D array dij(i and j are subscripts). I want to be able to do dij = di,j-1+(di,j-1 – di-1,dj-1)/(4^j-1) My idea for this it to make to 1D arrays and then combine them into a 2D array. Is there an easier way to do this?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Since n is 10, I would definitely just preallocate the array like this:
Then put in your d(1,1) element and handle your first row explicitly (I’m guessing that you just don’t include the terms that deal with the previous row) before looping through the rest of the rows.