I have an If loop:
if rollang >= 30 && pitchang >= 30
distance = ( ( (180 / rollang) + (90 / pitchang) ) / 2 ) * 100;
Z(a,b) = distance;
It is nested within a for loop that changes the values of rollang and pitchang. Z is a matrix of zeros. I want to put the value of "distance" in the place of that position each round of the for loop. For example the pitchangle and rollang are 20 and 30 respectively. Therefore distance will equal 600. Therefore I want to put 600 in the position (row =4, column = 5). What do I put in place of a and b in the function Z? I have tried Z((( rollang + 20 ) / 10), (( pitchang + 20 ) / 10))= distance
Hoping that it will place 600 in that spot. When I do that it says "Subscripted assignment dimension mismatch."
Maybe there is a better way to fill out the 3D matrix. Anything helps! Thank you kindly.
Here is a full picture of my code: