properties (Access = public)
UIFigure matlab.ui.Figure
SCANButton matlab.ui.control.Button
NutrientsCaloriesButton matlab.ui.control.Button
Label matlab.ui.control.Label
Label2 matlab.ui.control.Label
UIAxes matlab.ui.control.UIAxes
properties (Access = private)
methods (Access = private)
app.inputsize=app.net.Layers(1).InputSize;
app.vidObj=videoinput('macvideo');
function SCANButtonPushed(app, event)
img=getsnapshot(app.vidObj);
image(img,'Parent',app.UIAxes);
app.newing=imresize(img,app.inputsize(1:2));
app.CName=classify(app.net,app.newing);
system(sprintf('say %s', CName0));
app.Label.Text=app.CName;
function NutrientsCaloriesButtonPushed(app, event)
FoodTable = readtable('foods.xlsx');
app.CName = FoodTable(strcmp(FoodTable.Name, app.CName), :);
fprintf(" CName has %d calories\n", app.CName1.Calories);
methods (Access = private)
function createComponents(app)
app.UIFigure = uifigure('Visible', 'off');
app.UIFigure.Color = [0.9294 0.6941 0.1255];
app.UIFigure.Position = [100 100 640 480];
app.UIFigure.Name = 'MATLAB App';
app.SCANButton = uibutton(app.UIFigure, 'push');
app.SCANButton.ButtonPushedFcn = createCallbackFcn(app, @SCANButtonPushed, true);
app.SCANButton.BackgroundColor = [0.651 0.651 0.651];
app.SCANButton.FontColor = [0.149 0.149 0.149];
app.SCANButton.Position = [148 432 100 22];
app.SCANButton.Text = 'SCAN';
app.NutrientsCaloriesButton = uibutton(app.UIFigure, 'push');
app.NutrientsCaloriesButton.ButtonPushedFcn = createCallbackFcn(app, @NutrientsCaloriesButtonPushed, true);
app.NutrientsCaloriesButton.BackgroundColor = [0.651 0.651 0.651];
app.NutrientsCaloriesButton.FontColor = [0.149 0.149 0.149];
app.NutrientsCaloriesButton.Position = [126 50 122 22];
app.NutrientsCaloriesButton.Text = 'Nutrients & Calories';
app.Label = uilabel(app.UIFigure);
app.Label.Position = [381 415 89 56];
app.Label2 = uilabel(app.UIFigure);
app.Label2.Position = [381 50 42 22];
app.Label2.Text = 'Label2';
app.UIAxes = uiaxes(app.UIFigure);
title(app.UIAxes, 'Picture of food')
app.UIAxes.Position = [37 107 548 300];
app.UIFigure.Visible = 'on';
methods (Access = public)
function app = sreen3_2_exported
registerApp(app, app.UIFigure)
runStartupFcn(app, @startupFcn)