Posts Tagged ‘Math’

Calculate Age.3

Graphical User Interface

Matlab is a tool to calculate any mathematic problems. It uses simple syntax, not as difficult such as C++ or other Javascript-based programmes.You can create graphical user interface ( GUI ) such image on the right which show how to calculate age. Below are the steps :

Open Matlab version R2007a, at my desktop, but otherwise you can have the latest one.

Then please select File, create a new GUI.

Select a static text toolbox on the left pane. Then type ‘ DOB :’ ( Date of Birth ). Place a drop-down menu toolbox to insert entry on the right side. Please open m-file editor to change : DOB=str2double(get(handles.DOB_input,’String’));

and give tag : ”  DOB”  for the drop-down toolbox by double  clicking it.

Select a static text toolbox  again and type ‘ # Leap Years : ‘. Insert edit text toolbox on the right, double click it and give tag ‘leap years’. Then type  :

leap_years=str2double(get(handles.leap_years_input,’String’));

within its m-file editor.