In this i have to do following operation mentioned:
Here value of a,b,z are changing continuously. For every value program will calculate value of 'y'.
It will become three dimensional array.
For entire these iterations i have to find out maximum value of 'y' and corresponding value of 'a' & 'b'.
I am facing one more problem, when i formulated array it was showing lot more zeros.
for p=1:6 a=2*p; for q=1:6 b=5*q;
for z=1:100 k=z*z; x=k*4+1; y=a*x+b*k+1; y(p,q,z)=y;
end end end
No products are associated with this question.
maxy = -inf; a_at_max = -inf; b_at_max = -inf;
then inside the loop, where you assign into y, test to see if the new value is greater than maxy, and if it is, record the a and b values