MATLAB: Error using horzcat Dimensions of arrays being concatenated are not consistent.

errorerror бMATLAB

Error using horzcat Dimensions of arrays being concatenated are not consistent.
The problem appears every time I press the number button
line 49
result = [app.Label_result.Text '1'];% '011'
The code or main body is as follows:

classdef RealCalculatorGlebPopov < matlab.apps.AppBase
% Properties that correspond to app components
properties (Access = public)
CalculatorUIFigure matlab.ui.Figure
Panel matlab.ui.container.Panel
digit7 matlab.ui.control.Button
digit8 matlab.ui.control.Button
digit9 matlab.ui.control.Button
digit4 matlab.ui.control.Button
digit5 matlab.ui.control.Button
digit6 matlab.ui.control.Button
digit1 matlab.ui.control.Button
digit2 matlab.ui.control.Button
digit3 matlab.ui.control.Button
dotButton matlab.ui.control.Button
digit0 matlab.ui.control.Button
button_clear matlab.ui.control.Button
button_plus matlab.ui.control.Button
button_result matlab.ui.control.Button
button_min matlab.ui.control.Button
button_dev matlab.ui.control.Button
Button_multi matlab.ui.control.Button
Panel_2 matlab.ui.container.Panel
Label_result matlab.ui.control.Label
end
properties (Access = private)
dotNumber
enableDot = 0;
integerNumber = 0;
num1;
num2;
sing; % + - x /
end
% Callbacks that handle component events
methods (Access = private)
% Button pushed function: digit1
function digit1ButtonPushed(app, event)
result = '0';
if app.enableDot == 1 % we add flout number here

app.dotNumber = [app.dotNumber '1'];
result = [num2str(app.integerNumber) '.' app.dotNumber];
else %normal process

result = [app.Label_result.Text '1'];% '011'
end
newResult = str2num(result);% convret to number becaus no need 0 at fir

app.Label_result.Text = result(newResult);
end
% Button pushed function: digit2
function digit2ButtonPushed(app, event)
result = '0';
if app.enableDot == 1 % we add flout number here
app.dotNumber = [app.dotNumber '2'];
result = [num2str(app.integerNumber) '.' app.dotNumber];
else %normal process
result = [app.Label_result.Text '2'];% '022'
end
newResult = str2num(result);% convret to number becaus no need 0 at fir
app.Label_result.Text = result(newResult);
end
% Button pushed function: digit3
function digit3ButtonPushed(app, event)
result = '0';
if app.enableDot == 1 % we add flout number here
app.dotNumber = [app.dotNumber '3'];
result = [num2str(app.integerNumber) '.' app.dotNumber];
else %normal process
result = [app.Label_result.Text '3'];% '033'
end
newResult = str2num(result);% convret to number becaus no need 0 at fir
app.Label_result.Text = result(newResult);
end
% Button pushed function: digit4
function digit4ButtonPushed(app, event)
result = '0';
if app.enableDot == 1 % we add flout number here
app.dotNumber = [app.dotNumber '4'];
result = [num2str(app.integerNumber) '.' app.dotNumber];
else %normal process
result = [app.Label_result.Text '4'];% '044'
end
newResult = str2num(result);% convret to number becaus no need 0 at fir
app.Label_result.Text = result(newResult);
end
% Button pushed function: digit5
function digit5ButtonPushed(app, event)
result = '0';
if app.enableDot == 1 % we add flout number here
app.dotNumber = [app.dotNumber '5'];
result = [num2str(app.integerNumber) '.' app.dotNumber];
else %normal process
result = [app.Label_result.Text '5'];% '055'
end
newResult = str2num(result);% convret to number becaus no need 0 at fir
app.Label_result.Text = result(newResult);
end
% Button pushed function: digit7
function digit7ButtonPushed(app, event)
result = '0';
if app.enableDot == 1 % we add flout number here
app.dotNumber = [app.dotNumber '7'];
result = [num2str(app.integerNumber) '.' app.dotNumber];
else %normal process
result = [app.Label_result.Text '7'];% '077'
end
newResult = str2num(result);% convret to number becaus no need 0 at fir
app.Label_result.Text = result(newResult);
end
% Button pushed function: digit6
function digit6ButtonPushed(app, event)
result = '0';
if app.enableDot == 1 % we add flout number here
app.dotNumber = [app.dotNumber '6'];
result = [num2str(app.integerNumber) '.' app.dotNumber];
else %normal process
result = [app.Label_result.Text '6'];% '066'
end
newResult = str2num(result);% convret to number becaus no need 0 at fir
app.Label_result.Text = result(newResult);
end
% Button pushed function: digit8
function digit8ButtonPushed(app, event)
result = '0';
if app.enableDot == 1 % we add flout number here
app.dotNumber = [app.dotNumber '8'];
result = [num2str(app.integerNumber) '.' app.dotNumber];
else %normal process
result = [app.Label_result.Text '8'];% '088'

end
newResult = str2num(result);% convret to number becaus no need 0 at fir
app.Label_result.Text = result(newResult);
end
% Button pushed function: digit9
function digit9ButtonPushed(app, event)
result = '0';
if app.enableDot == 1 % we add flout number here
app.dotNumber = [app.dotNumber '8'];
result = [num2str(app.integerNumber) '.' app.dotNumber];
else %normal process
result = [app.Label_result.Text '8'];% '088'
end
newResult = str2num(result);% convret to number becaus no need 0 at fir
app.Label_result.Text = result(newResult);
end
% Button pushed function: digit0
function digit0ButtonPushed(app, event)
result = '0';
if app.enableDot == 1 % we add flout number here
app.dotNumber = [app.dotNumber '0'];
result = [num2str(app.integerNumber) '.' app.dotNumber];
else %normal process
result = [app.Label_result.Text '0'];% '000'
end
newResult = str2num(result);% convret to number becaus no need 0 at fir
app.Label_result.Text = result(newResult);
end
% Button pushed function: dotButton
function dotButtonButtonPushed(app, event)
app.enableDot = 1;
app.integerNumber = str2num(app.Label_result.Text);
end
% Button pushed function: button_clear
function button_clearButtonPushed(app, event)
app.Label_result.Text = '0' ;
app.integerNumber = 0;
app.dotNumber = '' ;
app.enableDot = 0; %disable dot number
end
% Button pushed function: button_plus
function button_plusButtonPushed(app, event)
app.sign = '+';
app.num1 = str2num(app.Label_result.Text);
app.Label_result.Text = '0';
app.integerNumber = 0;
app.dotNumber = '';
app.enableDot = 0;
end
% Button pushed function: button_result
function button_resultButtonPushed(app, event)
app.num2 = str2num(app.Label_result.Text);
if app.sign == '+'
app.Label_result.Text = num2str(app.num1+app.num2);
elseif app.sign == '-'
app.Label_result.Text = num2str(app.num1-app.num2);
elseif app.sign == 'x'
app.Label_result.Text = num2str(app.num1*app.num2);
elseif app.sign == '/'
app.Label_result.Text = num2str(app.num1/app.num2);
end
end
% Button pushed function: button_min
function button_minButtonPushed(app, event)
app.sign = '-';
app.num1 = str2num(app.Label_result.Text);
app.Label_result.Text = '0';
app.integerNumber = 0;
app.dotNumber = '';
app.enableDot = 0;
end
% Button pushed function: button_dev
function button_devButtonPushed(app, event)
app.sign = '/';
app.num1 = str2num(app.Label_result.Text);
app.Label_result.Text = '0';
app.integerNumber = 0;
app.dotNumber = '';
app.enableDot = 0;
end
% Button pushed function: Button_multi
function Button_multiPushed(app, event)
app.sign = 'x';
app.num1 = str2num(app.Label_result.Text);
app.Label_result.Text = '0';
app.integerNumber = 0;
app.dotNumber = '';
app.enableDot = 0;
end
end
% Component initialization
methods (Access = private)
% Create UIFigure and components

function createComponents(app)
% Create CalculatorUIFigure and hide until all components are created
app.CalculatorUIFigure = uifigure('Visible', 'off');
app.CalculatorUIFigure.Color = [0.7176 0.2745 1];
app.CalculatorUIFigure.Position = [100 100 560 457];
app.CalculatorUIFigure.Name = 'Calculator';
% Create Panel
app.Panel = uipanel(app.CalculatorUIFigure);
app.Panel.Position = [19 21 525 328];
% Create digit7
app.digit7 = uibutton(app.Panel, 'push');
app.digit7.ButtonPushedFcn = createCallbackFcn(app, @digit7ButtonPushed, true);
app.digit7.FontSize = 25;
app.digit7.Position = [21 255 100 40];
app.digit7.Text = '7';
% Create digit8
app.digit8 = uibutton(app.Panel, 'push');
app.digit8.ButtonPushedFcn = createCallbackFcn(app, @digit8ButtonPushed, true);
app.digit8.FontSize = 25;
app.digit8.Position = [143 255 100 40];
app.digit8.Text = '8';
% Create digit9
app.digit9 = uibutton(app.Panel, 'push');
app.digit9.ButtonPushedFcn = createCallbackFcn(app, @digit9ButtonPushed, true);
app.digit9.FontSize = 25;
app.digit9.Position = [269 255 100 40];
app.digit9.Text = '9';
% Create digit4
app.digit4 = uibutton(app.Panel, 'push');
app.digit4.ButtonPushedFcn = createCallbackFcn(app, @digit4ButtonPushed, true);
app.digit4.FontSize = 25;
app.digit4.Position = [21 200 100 40];

Best Answer

Your label is getting defined as having 2 values (see line 404).
app.Label_result.Text = {'0'; ''};
This appears to be because the original value is defined as "0."
Remove the period, and the error goes away.
I did notice that there are other problems still to fix, but now you can continue your testing and debugging.