CCNY. BME 2200: BME Biostatistics and Research Methods. Lecture 4: Graphing data with MATLAB

Similar documents
BME I5000: Biomedical Imaging

Introduction to MATLAB

Introduction to MatLab. Introduction to MatLab K. Craig 1

GRAPHICS AND VISUALISATION WITH MATLAB

Introduction to Matlab

EXERCISES Introduction to MATLAB: Graphics

Matlab notes Matlab is a matrix-based, high-performance language for technical computing It integrates computation, visualisation and programming usin

An Introduction to MATLAB II

Plotting using Matlab. Vytautas Astromskas

Introduction to MATLAB LAB 1

Overview. Lecture 13: Graphics and Visualisation. Graphics & Visualisation 2D plotting. Graphics and visualisation of data in Matlab

Lecture 3 for Math 398 Section 952: Graphics in Matlab

Graphical Presentation of Data

Nuts & Bolts guide to MATLAB

Introduction to MATLAB

Matlab Practice Sessions

What is MATLAB? It is a high-level programming language. for numerical computations for symbolic computations for scientific visualizations

Basic plotting commands Types of plots Customizing plots graphically Specifying color Customizing plots programmatically Exporting figures

MATLAB Laboratory 09/23/10 Lecture. Chapters 5 and 9: Plotting

NENS 230 Assignment 4: Data Visualization

This module aims to introduce Precalculus high school students to the basic capabilities of Matlab by using functions. Matlab will be used in

Modeling and Simulating Social Systems with MATLAB

EGR 102 Introduction to Engineering Modeling. Lab 05B Plotting

PERI INSTITUTE OF TECHNOLOGY DEPARTMENT OF ECE TWO DAYS NATIONAL LEVEL WORKSHOP ON COMMUNICATIONS & IMAGE PROCESSING "CIPM 2017" Matlab Fun - 2

Introduction to Programming in MATLAB

Introduction to the MATLAB SIMULINK Program

PROGRAMMING WITH MATLAB WEEK 6

Getting Started with MATLAB

Graphics Example a final product:

Matlab Tutorial: Basics

Armstrong Atlantic State University Engineering Studies MATLAB Marina 2D Plotting Primer

W1005 Intro to CS and Programming in MATLAB. Plo9ng & Visualiza?on. Fall 2014 Instructor: Ilia Vovsha. hgp://

INC151 Electrical Engineering Software Practice. MATLAB Graphics. Dr.Wanchak Lenwari :Control System and Instrumentation Engineering, KMUTT 1

Desktop Command window

2D LINE PLOTS... 1 The plot() Command... 1 Labeling and Annotating Figures... 5 The subplot() Command... 7 The polarplot() Command...

MATH 2221A Mathematics Laboratory II

Introduction to R Programming

A Brief Introduction to MATLAB

Lab 6: Graphical Methods

Information for Candidates. Test Format

CE890 / ENE801 Lecture 1 Introduction to MATLAB

Logical Subscripting: This kind of subscripting can be done in one step by specifying the logical operation as the subscripting expression.

Assignment 02 (Due: Monday, February 1, 2016)

Octave Tutorial Machine Learning WS 12/13 Umer Khan Information Systems and Machine Learning Lab (ISMLL) University of Hildesheim, Germany

matlab_intro.html Page 1 of 5 Date: Tuesday, September 6, 2005

Matlab Tutorial 1: Working with variables, arrays, and plotting

Getting started with Matlab: Outline

Command Line and Python Introduction. Jennifer Helsby, Eric Potash Computation for Public Policy Lecture 2: January 7, 2016

Lecturer: Keyvan Dehmamy

Basic Plotting. All plotting commands have similar interface: Most commonly used plotting commands include the following.

GRAD6/8104; INES 8090 Spatial Statistic Spring 2017

STAT 391 Handout 1 Making Plots with Matlab Mar 26, 2006

A Quick Tutorial on MATLAB. Zeeshan Ali

Matrices and three-dimensional graphing

INTRODUCTION TO MATLAB, SIMULINK, AND THE COMMUNICATION TOOLBOX

Lab of COMP 406 Introduction of Matlab (II) Graphics and Visualization

Plotting x-y (2D) and x, y, z (3D) graphs

How to learn MATLAB? Some predefined variables

Graphics in MATLAB. Responsible teacher: Anatoliy Malyarenko. November 10, Abstract. Basic Plotting Commands

Computing Fundamentals Plotting

The Department of Engineering Science The University of Auckland Welcome to ENGGEN 131 Engineering Computation and Software Development

Name: Math Analytic Geometry and Calculus III - Spring Matlab Project - due on Wednesday, March 30

FF505/FY505 Computational Science. MATLAB Graphics. Marco Chiarandini

Getting Started with MATLAB

% Close all figure windows % Start figure window

EL2310 Scientific Programming LAB1: MATLAB lab session. Patric Jensfelt

INTRODUCTION TO MATLAB PLOTTING WITH MATLAB

To make sense of data, you can start by answering the following questions:

INTERNATIONAL EDITION. MATLAB for Engineers. Third Edition. Holly Moore

Plotting - Practice session

MATLAB Tutorial. Primary Author: Shoumik Chatterjee Secondary Author: Dr. Chuan Li

UNIVERSITI TEKNIKAL MALAYSIA MELAKA FAKULTI KEJURUTERAAN ELEKTRONIK DAN KEJURUTERAAN KOMPUTER

Matlab for FMRI Module 1: the basics Instructor: Luis Hernandez-Garcia

DATA PLOTTING WITH MATLAB

MATLAB BASICS. < Any system: Enter quit at Matlab prompt < PC/Windows: Close command window < To interrupt execution: Enter Ctrl-c.

PSY8219 : Week 6. Homework 5 Due Today. Homework 6 Due October 8. Readings for Today Attaway Chapter 6, 10, and 12

Data Mining: Exploring Data. Lecture Notes for Chapter 3

Fundamentals of MATLAB Usage

Practical 4: The Integrate & Fire neuron

k-nn classification & Statistical Pattern Recognition

A Guide to Using Some Basic MATLAB Functions

Mechanical Engineering Department Second Year (2015)

Getting started with MATLAB

Matlab Introduction. Scalar Variables and Arithmetic Operators

1-- Pre-Lab The Pre-Lab this first week is short and straightforward. Make sure that you read through the information below prior to coming to lab.

Introduction to MATLAB

Image Processing CS 6640 : An Introduction to MATLAB Basics Bo Wang and Avantika Vardhan

A Very Brief Introduction to Matlab

Data Mining: Exploring Data. Lecture Notes for Chapter 3. Introduction to Data Mining

MATLAB & Practical Application on Climate Variability Studies EXERCISES

Question. Dinner at the Urquhart House. Data, Statistics, and Spreadsheets. Data. Types of Data. Statistics and Data

Data Mining: Exploring Data. Lecture Notes for Chapter 3

Data Mining: Exploring Data. Lecture Notes for Data Exploration Chapter. Introduction to Data Mining

EOSC 473/573 Matlab Tutorial R. Pawlowicz with changes by M. Halverson

Introduction to MATLAB: Graphics

GUI Alternatives. Syntax. Description. MATLAB Function Reference plot. 2-D line plot

Matlab Handout Nancy Chen Math 19 Fall 2004

MATLAB INTRODUCTION. Matlab can be used interactively as a super hand calculator, or, more powerfully, run using scripts (i.e., programs).

Prof. Manoochehr Shirzaei. RaTlab.asu.edu

MATLAB Tutorial. Digital Signal Processing. Course Details. Topics. MATLAB Environment. Introduction. Digital Signal Processing (DSP)

Transcription:

BME 2200: BME Biostatistics and Research Methods Lecture 4: Graphing data with MATLAB Lucas C. Parra Biomedical Engineering Department CCNY parra@ccny.cuny.edu 1

Content, Schedule 1. Scientific literature: Literature search Structure biomedical papers, engineering papers, technical reports Experimental design, correlation, causality. 2. Presentation skills: Report Written report on literature search (individual) Talk Oral presentation on biomedical implant (individual and group) 3. Graphical representation of data: Introduction to MATLAB Plot formats: line, scatter, polar, surface, contour, bar-graph, error bars. etc. Labeling: title, label, grid, legend, etc. Statistics: histogram, percentile, mean, variance, standard error, box plot 4. Biostatistics: Basics of probability t-test, ANOVA Linear regression, cross-validation Error analysis Test power, sensitivity, specificity, ROC analysis 2

In class observational study Before we start with plotting data we will collect some anonymous and voluntary data: heart pulse rate, height, gender, age, weight. The objective is to find relations between these variables. Example dependent variable Independent variable 3

4 Introduction to MATLAB Basic matrix operations y=[ 1, 4, 5] x=[ 1 2 3; 3 4 5] x(1,1), x(:,2) x = [x; y]; x= [x x]; size, length x' x.^2 x(:,:,:) Writing and executing a matlab program A program is a simple text files with the same commands as you have typed in the command window with ending.m, e.g. john_smith_1.m Execute 'john_smith_1.m' by typing in the command window: >> john_smith_1

5 Basic line and scatter plot plot(x) plot(x') plot(x,y) plot(x,y,'+') plot(x,y,'g') plot(x(:,1),y(:,1),'+b'); hold on plot(x(:,2),y(:,2),'or'); hold off

6 Basic bar graphs subplot(2,2,1) barh(mean([height weight pulse])) subplot(2,2,1) bar([grp_height; grp_weight; grp_pulse]),

Basic bar graphs pie, bar, hist, legend, set(gca,'xticklable',labels) 7

8 Basic 3D graphs

9 Labeling, axis, color, printing, etc. xlabel, ylabel, title, legend, gtext, ginput subplot, suptitle, xlim, ylim, axis, colorbar, colormap, caxis saveas, print

10 Changing any property of a figure get, set ax=plotyy(1:n,height,1:n,weight); set(get(ax(1),'ylabel'),'string','height (cm)') set(get(ax(2),'ylabel'),'string','weight (Kg)') set(get(ax(1),'children'),'linewidth',2) set(get(ax(2),'children'),'linewidth',2) Assignment 5: Write a matlab program that generates figures in slides 5, 6, 7, 8, 10 using the data we collected in class. Do not use all the same data to plot, we have pulse, age, height, weight, etc.

11 Loading, Saving, Importing, Exporting load, save textread fread, fwrite imgread, xlsread,...

Programing Assignments (read carefully!) If you copy code you will fail the course. Due one week after assignment. Submit by email before class. Submit single executable file called: first_last_number.m, all lower case e.g. john_smith_3.m for John's 3 rd assignment. No figures, no text files, nothing except executable code. Your program must load all required data. Assume that data files are in current directory. All required data will be posted on the web. Include 'clear all, close all' at the beginning of all programs. Do not use upper case letters for commands, e.g. Use axis() instead of 'AXIS()'. They may work for you but they don't work for me! If you had help during your work, you MUST name your partner. "Similar" submission are easy to spot. Undisclosed collaborations receive 0 credit. The criteria for full credit should be clear. If not, please ask in class. Do not take chances by assuming that your work is "sort of correct". 12

13 Where to get more help on MATLAB For help on MATLAB run Useful functions >> demo >> help >> lookfor >> whos Familiarize yourself in particular with the set of graphing functions: >> help graph2d >> help graph3d >> help graphics >> help specgraph If you are new to MATLAB, please make substantial time available to run the demo programs which are a very good introduction: basic matrix operations matrix manipulations graphs and matrices MATLAB language introduction line plotting 2-D plots axis properties, desktop environment demos