How can I make true false codition?
Show older comments
Hello, I have witten a code for automating two instruments. In my code I wrote in step by step but the camera is taking image instantly before completing the for loop. and the statement after the catureimage is also being executed instantly. I need to make condition where capture image will be performed when the desired array elements in the for loop becomes true. And i need to make a codition where the stop statement will ocuur if the acquired imge is done. Can anyone please help me with this? I have attached my code here:
dmd = uint8(ones(768,1024)); %dmd mirror matrix model
store_results = uint8(zeros(768,1024)); %dummy matrix to track results i.e. what is positive, what is negative
myapi = alpload();
mydev = alpdevice(myapi);
%mydev.alloc();
%q1
for i = 1:512, j = 1:384; %row coordinate 300-400 previous[1:length(transpose(dmd))]%column coordinate 1: length(dmd);
dmd(i,j) = 255 ; %set coordinate deliberately ON (pixel value??)400-500
%******my frame********
myframe = dmd;%... (your code to create an array 1024x768 of 'uint8') = dmd %in the for loop
mydev.put(myframe);
end
%turn on camera, take image
Image = captureimage();
% % % %stop dmd
mydev.stop();
Accepted Answer
More Answers (0)
Categories
Find more on Video Formats and Interfaces 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!