So I know I could do this with a loop, but since I'm already inside a nested loop for this I'm trying to minimize how nested things get. The problem occurs without the loops so I'll just provide an example of the point of failure I'm encountering. Here are the variables and their relationship to one another. Depletion is a large matrix with data values in it.
jj = 1; i = 1; v1 = Depletion(2*jj-1,i) v2 = Depletion(2*jj,i) v3 = max([MatDeni(v1,jj) MatDeni(v2,jj)]) v4 = min([MatDeni(v1,jj) MatDeni(v2,jj)]) v5 = mean([MatDeni(v1,jj) MatDeni(v2,jj)]) v6 = min(MatDeni(v1:v2,jj)) v7 = Ledge + int16((v2 - v1)/2)
When I run this the output I get is:
v1 = 1086v2 = 1115v3 = 5.7254e+05v4 = 4.4962e+05v5 = 5.1108e+05v6 = 23322v7 = 1101
Now I try to put these values into a vector. When I do just v1-v6 everything is fine
[v1 v2 v3 v4 v5 v6]
returns
ans = 1086 1115 5.7254e+05 4.4962e+05 5.1108e+05 23322
however when I do v1-v7,
[v1 v2 v3 v4 v5 v6 v7]
returns
ans = 1086 1115 32767 32767 32767 23322 1101
It seems the values in scientific notation have been changed to some apparently arbitrary value of 32767. Maybe I should just change the format that the values get stored so they're not scientific notation, but this seems like strange behavior.
Best Answer