DATA RETRIEVAL AND GUI CREATION DAVID COOPER SUMMER 2014.

Slides:



Advertisements
Similar presentations
Microsoft Expression Web-Illustrated Unit J: Creating Forms.
Advertisements

How to Import an Excel File Using the SAS Import Wizard SAS 9 for Windows.
KompoZer. This is what KompoZer will look like with a blank document open. As you can see, there are a lot of icons for beginning users. But don't be.
11 Getting Started with ASP.NET Beginning ASP.NET 4.0 in C# 2010 Chapters 5 and 6.
Microsoft Visual Basic: Reloaded Chapter Seven More on the Repetition Structure.
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
Integrating Access with the Web and with Other Programs.
Creating Custom Forms. 2 Design and create a custom form You can create a custom form by modifying an existing form or creating a new form. Either way,
8 November Forms and JavaScript. Types of Inputs Radio Buttons (select one of a list) Checkbox (select as many as wanted) Text inputs (user types text)
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
SPSS 1: An Introduction to the Statistical Package SPSS Suzie Cro MRC Clinical Trials Unit.
Creating Web Page Forms
Matlab GUIs Making Matlab Interactive. Today’s topics What is a GUI? How does a GUI work? Where do you begin? Ways to build MATLAB GUIs.
Using Microsoft Outlook: Basics. Objectives Guided Tour of Outlook –Identification –Views Basics –Contacts –Folders –Web Access Q&A.
Android 4: Creating Contents Kirk Scott 1. Outline 4.1 Planning Contents 4.2 GIMP and Free Sound Recorder 4.3 Using FlashCardMaker to Create an XML File.
Form Handling, Validation and Functions. Form Handling Forms are a graphical user interfaces (GUIs) that enables the interaction between users and servers.
Chapter 9 Collecting Data with Forms. A form on a web page consists of form objects such as text boxes or radio buttons into which users type information.
Microsoft Visual Basic 2005 CHAPTER 8 Using Procedures and Exception Handling.
Using Dreamweaver. Slide 1 Dreamweaver has 2 screens that do different things The Document window where you create your WebPages The Site window where.
Chapter 6: Forms JavaScript - Introductory. Previewing the Product Registration Form.
© 2011 Delmar, Cengage Learning Chapter 9 Collecting Data with Forms.
Microsoft Visual Basic 2012 Using Procedures and Exception Handling CHAPTER SEVEN.
XP New Perspectives on Microsoft Access 2002 Tutorial 51 Microsoft Access 2002 Tutorial 5 – Enhancing a Table’s Design, and Creating Advanced Queries and.
XHTML Introductory1 Forms Chapter 7. XHTML Introductory2 Objectives In this chapter, you will: Study elements Learn about input fields Use the element.
Department of Mechanical Engineering, LSUSession VII MATLAB Tutorials Session VIII Graphical User Interface using MATLAB Rajeev Madazhy
Matlab GUIs GUIDE.
Objectives Understand what MATLAB is and why it is widely used in engineering and science Start the MATLAB program and solve simple problems in the command.
Introduction to Matlab & Data Analysis
Chapter 3: Using GUI Objects and the Visual Studio IDE.
XP New Perspectives on Integrating Microsoft Office XP Tutorial 2 1 Integrating Microsoft Office XP Tutorial 2 – Integrating Word, Excel, and Access.
GUI development with Matlab: GUI Front Panel Components 1 GUI front panel components In this section, we will look at -GUI front panel components -Programming.
6 th Annual Focus Users’ Conference Manage Integrations Presented by: Mike Morris.
CREATING TEMPLATES CREATING CUSTOM CHARACTERS IMPORTING BATCH DATA SAVING DATA & TEMPLATES CREATING SERIES DATA PRINTING THE DATA.
Chapter 8 Collecting Data with Forms. Chapter 8 Lessons Introduction 1.Plan and create a form 2.Edit and format a form 3.Work with form objects 4.Test.
Creating Buttons – Lesson 51 Creating Buttons Lesson 5.
 Whether using paper forms or forms on the web, forms are used for gathering information. User enter information into designated areas, or fields. Forms.
Introduction to Matlab’s Graphical User Interface (GUI) Type “guide” “Guide” creates interface on a Figure window and code in an M-file. Some hidden code.
Forms and Server Side Includes. What are Forms? Forms are used to get user input We’ve all used them before. For example, ever had to sign up for courses.
This eCPIC Quick Guide has been developed to assist System Administrators with creating Hierarchy Grids in eCPIC. The Hierarchy Grid functionality allows.
Creating Graphical User Interfaces (GUI’s) with MATLAB By Jeffrey A. Webb OSU Gateway Coalition Member.
Introduction to Matlab & Data Analysis 2015 In this tutorial we will: Build a practical application using GUIDE Learn more about graphical user interface.
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
MATLAB for Engineers 4E, by Holly Moore. © 2014 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. This material is protected by Copyright.
LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE HTML and CSS 8th Edition Chapter 8: Working with Style Sheets.
Files: By the end of this class you should be able to: Prepare for EXAM 1. create an ASCII file describe the nature of an ASCII text Use and describe string.
Lesson 4.  After a table has been created, you may need to modify it. You can make many changes to a table—or other database object—using its property.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
1 Lecture 4 Post-Graduate Students Advanced Programming (Introduction to MATLAB) Code: ENG 505 Dr. Basheer M. Nasef Computers & Systems Dept.
EGR 115 Introduction to Computing for Engineers
Basic ActionScript and PHP Cis 126. Getting Started set up a basic folder structure so we can keep our files organized. Mirror this structure on your.
Introduction to Matlab Module #10 Page 1 Introduction to Matlab Module #10 – Creating Graphical User Interfaces Topics 1.Overview of GUI Development using.
Microsoft Office 2013 Try It! Chapter 4 Storing Data in Access.
Files in Python The Basics. Why use Files? Very small amounts of data – just hardcode them into the program A few pieces of data – ask the user to input.
XP New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 8 1 Microsoft Office Access 2003 Tutorial 8 – Integrating Access with the.
XP New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 6 1 Microsoft Office Access 2003 Tutorial 6 – Creating Custom Forms.
MATLAB and SimulinkLecture 61 To days Outline Graphical User Interface (GUI) Exercise on this days topics.
PATTERN RECOGNITION LAB 8 TA : Nouf Al-Harbi::
Microsoft Visual C# 2010 Fourth Edition Chapter 3 Using GUI Objects and the Visual Studio IDE.
COMPREHENSIVE Excel Tutorial 12 Expanding Excel with Visual Basic for Applications.
Reading and Writing Image Files
Graphical User Interface in MATLAB
WORKSHOP 3 GSE IMPORT.
More on Graphical User Interfaces
12 Product Configurator
Microsoft Office Access 2003
Microsoft Office Access 2003
Microsoft Office Access 2003
Microsoft Office Access 2003
funCTIONs and Data Import/Export
Chapter 1 Introducing Small Basic
Presentation transcript:

DATA RETRIEVAL AND GUI CREATION DAVID COOPER SUMMER 2014

Loading data As you begin to create figures and scripts you might begin to have issues with data management. Preloading you data will not always be possible and you may wish to have it load in your script For data that is the.mat file type use load() >> load(‘filename.mat’) If you want to be certain that the data can be loaded from any location use the whole pathname and filename >> load(‘C:\Users\Owner\Documents\MATLAB\filename.mat’) To force MATLAB to open a file as if it were a.mat use the ‘-mat’ tag >> load(‘filename’, ‘-mat’)

Loading from ASCII The load() function can also load in text files if the data is properly formatted. >> load(‘filename’, ‘-ascii’) Many instruments have an output option that will export an ascii file Common file extensions for ascii files are.txt and.dat To test whether or not a file is an ascii file use a basic text editor like Notepad. Notepad will also allow you to edit the text to ensure that MATLAB can read it correctly.

Extracting from Figures When creating figures you can also save the figure as a.fig file If you have a.fig file you can also load all of the information in the figure into MATLAB to be used later MATLAB figures work in a hierarchy fashion which can be manipulated using the figure handles To begin extracting the data from a figure use the open() function to regenerate the figure in the current MATLAB space >> open(‘filename.fig’)

How Handles Work Handles function as the address for which the information they contain is stored >> hFig = gcf; By themselves they are meaningless but can be used to get and set the properties that they contain indirectly The hierarchy of Figure handles looks like this

Retrieving data with get() To see all of the available Properties that can be retrieved and their values use the get() function >> get(hFig) The data in a figure is located in one of the axes in the figure. The first step to retrieving the data is to get the handle of the axes. >> hAxes = get(hFig, ‘Children’) Then you need to get the handle of the data object (your plot) >> hData = get(hAxes, ‘Children’) Finally the data can be retrieved with the Xdata and Ydata for line plots. Other plot types will have different structures but the principle will be similar >> x = get(hData, ‘XData’) >> y = get(hData, ‘Ydata’)

Excel One of the standard data files that you may come across are Microsoft Excel files (.xls and.xlsx) The xlsread() function will be able to load an excell file and transfer the numbers to a variable >> ExcelData = xlsread(‘filename.xlsx’) Note that MATLAB preferentially loads the numbers from an excel sheet and will ignore plots and strings

Non-Standard formats For non standard file types MATLAB allows for binary reading To begin use fopen() to start reading a file. You will want to assign it to a variable to pass to the file functions >> FileID = fopen(‘filename’) When dealing with binary files, you will need to find documentation detailing whatever file type you are attempting to read Remember If you know what type a data you are reading you can figure out how big it is.

Reading Binaries The key to reading binary files is knowing where you are and moving to the correct locations The two main functions in file reading are fread() and fseek() >> Data = fread(FileID, size, precision) >> fseek(FileID, numBits, origin) fread() will read out the next size bits. If a precision type is set then it will use the base number of bits for that type instead and treat the result as the precision data type Most binary files will have a header that contains information on where data is located in the binary file. With that information you can use fseek() to jump in the file to specific locations

Simple UI functions For maximum amount of customizability you will ask the user to choose where the data that they want to import is located To open up a file browser window use the uigetfile() function >> [outfilename, outpathname] = uigetfile(Filter); It is almost always better to assign the filename and the pathname to allow for easy data retrieval. If you want to have the user define a location to save a file instead of hardcoding it use the uiputfile() function >> [outfilename, outpathname] = uiputfile(defaultFileName); Additionally the fileparts() function will allow MATLAB to read the pathname, filename and extension type of an input file >> [pathstr, filename, ext] = fileparts(filename);

GUI If you are trying to create a function or set of functions that you want easy visual access to MATLAB allows for the creation of custom GUIs GUI stands for Graphical User Interface and is the portal through which an end user will operate your code GUIs are THE standard for interaction with any software system and can allow the more intricate tasks to run behind the scenes while only showing the user the most relevant data If you are creating code specifically for others to use (like you might do for a publication) GUIs are the way to go In MATLAB GUIs are esentially a very advanced figure type and will follow many of the same conventions with respect to handles

Making a new GUI GUIDE is MATLAB’s built in GUI creator Create a new GUI by selecting it under the new menu in the home tab Note: If you can not see the names for all of the graphics options you can change it in the GUIDE preferences

GUI design Once the GUIDE window is open you can add graphics items to it The Push Button is the standard click and run set function. Radio Buttons are used to select a single option of several pre defined choices. They should be used inside a button group Axes allow for figure axes to be added to the GUI to plot data Double clicking on a item or right clicking and selecting property inspector will allow you to edit all of the properties of each item The Tag property is one of the most useful properties as a designer because it will let you specify what the identifier for that object is

Adding Functionality Saving the GUI in GUIDE will create two files the first which holds the image information and the second which contains the function information handles is the structure variable created in every GUI that allows for designer created information to be passed around. Anytime you add or modify a variable under the handles structure you need to add the following >> guidata(hObject, handles); Each of the created buttons will have a pregenerated field that is named after the Tag you created for that object To plot data you will need to set the current axis to the appropriate axes handle >> set(gcf, ‘CurrentAxes”, handles.AxisTag)