Thanks all, but here's the thing. I'm not using global variables, I have checked all my variable names to make sure they have an individual name, I am comparing numbers to numbers, and I am using either large values for my variables, 0's, or 1's. All my other if statements are working fine though. Here is a sample of code more closely related to where the problem is occurring, it might help with a solution.
function [] = trial(test)
disp(test)
if(test == 1)
disp(test)
disp('test is one')
end
if(test == 2)
disp(test)
disp('test is two')
end
if(test == 3)
disp(test)
disp('test is three')
end
if(test == 4)
disp(test)
disp('test is four')
end
disp(test)
then I execute.
trial(0)
What happens during the function is that the variable test will get a random value assigned to it so I would get
0
0
'test equals (one, two, three, or four)'
0
This does not happen ever time the function is ran however, but at random, sometimes it works the way I want it to, but other times it does the above. Like I said it is only for the if statements dealing with the variable test, and another section of my code that involves a different variable with different conditions. Just to reiterate it, I have already knocked the probable problems down. If anyone is feeling helpful enough, and doesn't feel like being a critic, I can email you, or post my code some where so you can look over it.