classdef app1 < matlab.apps.AppBase
% Properties that correspond to app components
properties (Access = public)
UIFigure matlab.ui.Figure
x2HS1EditFieldLabel matlab.ui.control.Label
hs1x2 matlab.ui.control.EditField
x1HS1EditField_2Label matlab.ui.control.Label
hs2x1 matlab.ui.control.EditField
HSEditFieldLabel matlab.ui.control.Label
HSEditField matlab.ui.control.EditField
x2HS2EditFieldLabel matlab.ui.control.Label
hs2x2 matlab.ui.control.EditField
end
properties (Access = private)
XCoord %Description
HS %Description
end
methods (Access = private)
% Value changed function: XCoordinatesEditField
function XCoordinatesEditFieldValueChanged(app, event)
app.XCoord = str2double(strsplit(event.Value));
app.HS = str2double(strsplit(app.HSEditField.Value));
if(length(app.XCoord) > 0 && length(app.HS)>0)
app.hs1x1.Enable = true;
app.hs1x1.Editable = true;
app.hs1x1.Visible = true;
app.x1HS1EditFieldLabel.Text = ['a at x = ', num2str(app.XCoord(1)), ', Hs = ', num2str(app.HS(1))];
end
if(length(app.XCoord) >= 2 && length(app.HS)>0)
app.hs1x2.Enable = true;
app.hs1x2.Editable = true;
app.hs1x2.Visible = true;
x2HS1EditFieldLabel.Text ="a at x = " + num2str(app.XCoord(2)) + ", Hs =" + num2str(app.HS(1));
end
if(length(app.HS) >= 2 && length(app.XCoord)>0)
app.hs2x1.Enable = true;
app.hs2x1.Editable = true;
app.hs2x1.Visible = true;
x1HS1EditField_2Label.Text = "a at x = " + num2str(app.XCoord(1)) + ", Hs = " + num2str(app.HS(2));
end
if(length(app.HS) >=2 && length(app.XCoord)>=2)
app.hs2x2.Enable = true;
app.hs2x2.Editable = true;
app.hs2x2.Visible = true;
x2HS2EditFieldLabel.Text = "a at x = " + num2str(app.XCoord(2)) + ", Hs = " + num2str(app.HS(2));
end
end
% Value changed function: HSEditField
function HSEditFieldValueChanged(app, event)
app.HS = str2double(strsplit(event.Value));
app.XCoord = str2double(strsplit(app.XCoordinatesEditField.Value));
if(length(app.XCoord) > 0 && length(app.HS)>0)
app.hs1x1.Enable = true;
app.hs1x1.Editable = true;
app.hs1x1.Visible = true;
app.x1HS1EditFieldLabel.Text = "a at x = " + num2str(app.XCoord(1)) + ", Hs = " + num2str(app.HS(1));
end
if(length(app.XCoord) >= 2 && length(app.HS)>0)
app.hs1x2.Enable = true;
app.hs1x2.Editable = true;
app.hs1x2.Visible = true;
x2HS1EditFieldLabel.Text ="a at x = " + num2str(app.XCoord(2)) + ", Hs =" + num2str(app.HS(1));
end
if(length(app.HS) >= 2 && length(app.XCoord)>0)
app.hs2x1.Enable = true;
app.hs2x1.Editable = true;
app.hs2x1.Visible = true;
x1HS1EditField_2Label.Text = "a at x = " + num2str(app.XCoord(1)) + ", Hs = " + num2str(app.HS(2));
end
if(length(app.HS) >=2 && length(app.XCoord)>=2)
app.hs2x2.Enable = true;
app.hs2x2.Editable = true;
app.hs2x2.Visible = true;
x2HS2EditFieldLabel.Text = "a at x = " + num2str(app.XCoord(2)) + ", Hs = " + num2str(app.HS(2));
end
end
end