- Do you receive warning and/or error messages? If so the full and exact text of those messages (all the text displayed in orange and/or red in the Command Window) may be useful in determining what's going on and how to avoid the warning and/or error.
- Does it do something different than what you expected? If so, what did it do and what did you expect it to do?
- Did MATLAB crash? If so please send the crash log file (with a description of what you were running or doing in MATLAB when the crash occured) to Technical Support so we can investigate.
DEBUGGING FOR STANDALONE APP ?
6 ビュー (過去 30 日間)
古いコメントを表示
Hope you are all doing well
I made an app using app designer to read a counter by screen shot using screencapture.m and to turn the light green if the number changed or red if stayed the same , when run with matlab it works great , but when trying it as a standalone exe on the same laptop the program does not work
classdef neuro < matlab.apps.AppBase
% Properties that correspond to app components
properties (Access = public)
UIFigure matlab.ui.Figure
Lamp matlab.ui.control.Lamp
LampLabel matlab.ui.control.Label
startButton matlab.ui.control.Button
end
% Callbacks that handle component events
methods (Access = private)
% Button pushed function: startButton
function startButtonPushed(app, event)
for in=1:inf
imageData = screencapture(0, [700,700,150,100]);
imwrite(imageData,'flag.jpg');
flag=ocr(imread('flag.jpg'))
n=str2num(flag.Text)
pause(.5)
imageData = screencapture(0, [700,700,150,100]);
imwrite(imageData,'flag.jpg');
flag=ocr(imread('flag.jpg'))
x=str2num(flag.Text)
image= uiimage(app.UIFigure,"ImageSource",'flag.jpg');
image.Position=[256,288,200,200];
if mod(n,1)==0
if mod(x,1)==0
if x==n
app.Lamp.Color = 'r'
else
app.Lamp.Color = 'g'
end
end
end
end
2 件のコメント
Steven Lord
2023 年 9 月 21 日
What does "does not work" mean in this context?
採用された回答
Rakan Khair
2023 年 9 月 22 日
編集済み: dpb
2025 年 4 月 26 日
1 件のコメント
Walter Roberson
2025 年 4 月 26 日
You could have done
imageData = screencapture(0, [700,700,150,100]);
flag = ocr(imageData);
without needing to write to file at all.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で MATLAB Compiler についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!