I am a current student and am relatively new to MATLAB. I am currently using an accelerometer as controller.
What I am trying to do is to replace an image when the accelerometer reads a value greater then a set threshold and return to the original image when it is not. This is what I currently have in a while loop
if handles.thresholdValue <= handles.gxFiltdata;
axes(handles.axes9); imshow('RED.JPEG'); else axes(handles.axes9); imshow('BLACK.JPEG'); end
As of right now the image starts off black and turns red and stays red regardless of whether or not the accelerometer reads above or below the threshold set
Put this before your if statement
fprintf('thresh=%f, gxFilt=%f\n', handles.thresholdValue, handles.gxFiltdata)
What does it show in the command window? Next, go here and watch it: http://blogs.mathworks.com/videos/category/gui-or-guide/