Can't load a .mat file due to infinite while loop

1 view (last 30 days)
Michael
Michael on 28 Jul 2014
Commented: dpb on 28 Jul 2014
I want to load in a .mat file into my program using the load function however I have an infinite while loop causing the file to not load unless there is a break. Is there anyway to fix this? Is there an easy replacement for my infinite loop? Thanks for any suggestions.
X and Y are motors
looprepeat = true;
x.MoveHome(0,0);
y.MoveHome(0,0);
pause(15);
load('locations.mat');
while looprepeat %Allows for user to move to row and column infinite time
row = input('Please enter in row number: ');
column = input('Please enter in column number: ');
y.MoveAbsolute(0,posy)
x.MoveAbsolute(0,posx)
pause(15);
for g = 1:row
y.MoveJog(0,1);
pause(3);
end
for k = 1:column
x.MoveJog(0,1);
pause(3);
end
end
  1 Comment
dpb
dpb on 28 Jul 2014
The file has already been loaded before you enter the loop; Matlab is sequential in operation. Are pos[x|y] supposed to be coming from there, mayhaps? If so, are they vectors and is there a problem w/ the method handling that with an absolute move?
Not enough info to really be able to say much...as for the loop what's to fix and what's the desired result to be?

Sign in to comment.

Answers (0)

Categories

Find more on Get Started with MATLAB in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!