EEE 242 Computer Tools for Electrical Engineering

Slides:



Advertisements
Similar presentations
MATLAB – A Computational Methods By Rohit Khokher Department of Computer Science, Sharda University, Greater Noida, India MATLAB – A Computational Methods.
Advertisements

CSE 123 Plots in MATLAB. Easiest way to plot Syntax: ezplot(fun) ezplot(fun,[min,max]) ezplot(fun2) ezplot(fun2,[xmin,xmax,ymin,ymax]) ezplot(fun) plots.
Introduction to Engineering MATLAB – 11 Plotting - 4 Agenda Multiple curves Multiple plot.
Digital Lesson on Graphs of Equations. Copyright © by Houghton Mifflin Company, Inc. All rights reserved. 2 The graph of an equation in two variables.
Chapter 11 Above: Principal contraction rates calculated from GPS velocities. Visualized using MATLAB.
Introduction to Matlab:
Fall 2006AE6382 Design Computing1 Three Dimensional Plotting Learning Objectives –Understand the anatomy of a 3D plot –Basics of constructing plots in.
Maths for Computer Graphics
Matlab for Visualization Ray Gasser IS&T Scientific Visualization Tutorial – Spring 2010.
EGR106 Week 6 MATLAB FILES Two Dimensional Plots Multiple Plots
[FX,FY,FZ,...] = GRADIENT(F,...) [FX,FY,FZ,…] is numerical gradient of matrix F Distance between grid points in X,Y,Z,… direction FX corresponds to dF/dx,
1 Introduction to MatLab MatLab stands for Matrix Laboratory. As the name suggests most of the programming operations have as input or output a matrix.
MATLAB Week 3 17 November Outline Graphics – Basic plotting – Editing plots from GUI – Editing plots from m-file – Advanced plotting commands.
 1999 BG Mobasseri1 8/29/2015 MATLAB GRAPHICS - PART II ADVANCED PLOTTING June 4, ‘99.
Chapter 5 Review: Plotting Introduction to MATLAB 7 Engineering 161.
MATLAB INTRO CONTROL LAB1  The Environment  The command prompt Getting Help : e.g help sin, lookfor cos Variables Vectors, Matrices, and Linear Algebra.
ENG College of Engineering Engineering Education Innovation Center 1 2D Plots 1 in MATLAB Topics Covered: 1.Plotting basic 2-D plots The plot()
Introduction to MATLAB January 18, 2008 Steve Gu Reference: Eta Kappa Nu, UCLA Iota Gamma Chapter, Introduction to MATLAB,
CMPS 1371 Introduction to Computing for Engineers PLOTTING.
ELG 3120 Signal and System Analysis 1 Introduction to MATLAB TAs Wei Zhang Ozgur Ekici (Section A)(Section B) ELG 3120 Lab Tutorial 1.
Computational Biology, Part E Basic Principles of Computer Graphics Robert F. Murphy Copyright  1996, 1999, 2000, All rights reserved.
MATLAB Week 4 01 December Outline More plotting – A few other 3-D plotting functions – Basic volume visualization Creating functions Vectorized.
Eng Ship Structures 1 Introduction to Matlab.
Vectors and Matrices In MATLAB a vector can be defined as row vector or as a column vector. A vector of length n can be visualized as matrix of size 1xn.
The Hong Kong Polytechnic University Industrial Centre 1 MatLAB Lesson 4 : Polynomial Edward Cheung Room W311g 2008.
Chapter 4 Review: Manipulating Matrices Introduction to MATLAB 7 Engineering 161.
Matlab for Engineers Manipulating Matlab Matrices Chapter 4.
MAE 1202: AEROSPACE PRACTICUM An Introduction to MATLAB: Part 2 Mechanical and Aerospace Engineering Department Florida Institute of Technology Developed.
Chapter 9 Transformations.
Recap Sum and Product Functions Matrix Size Function Variance and Standard Deviation Random Numbers Complex Numbers.
Matlab 14.html Cost: $100 Available in labs on Windows and Unix machines.
Introduction MATLAB stands for MATrix LABoratory.  Basics  Matrix Manipulations  MATLAB Programming  Graphics  Image types  Image Processing  Useful.
Introduction to MATLAB Session 5 Simopekka Vänskä, THL 2010.
ENG College of Engineering Engineering Education Innovation Center 1 Array Accessing and Strings in MATLAB Topics Covered: 1.Array addressing. 2.
Faculty of Electrical Engineering 1 Lecture : En. Syahrom Bin Zakaria EC202 COMPUTER AIDED DESIGN.
2D Routines in 3D. Outline Announcements –HW II--due Friday. 5PM HW1 & Cookie Grids & Meshes Representing f(x,y) Lines & Surfaces in 3D Survey.
Recap Chapter 5 “Plotting” Two Dimensional Plots Simple x-y Plots Titles, Labels and Grids Multiple Plots.
Recap Plots with More than one Line Plots of Complex Arrays Line, Color and Mark Style Axis Scaling and Annotating Plots Subplots Polar Plots Logarithmic.
EGR 106 Lecture 6 2-D Plotting Graphical presentation has become the standard method to show technical information. Engineers use plots to analyze, visualize,
3.6 Solving Systems Using Matrices You can use a matrix to represent and solve a system of equations without writing the variables. A matrix is a rectangular.
Programming with Matlab Day 2: More about Loops, Vectors and Matrices.
1 Lecture 5 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 Complex Numbers & 3D Plots – Part 2 Friday 07 Nov 2014 EGR 115 Introduction to Computing for Engineers.
COM366 Interactive Computer Graphics Topic 1 : Introduction.
Computer Graphics Matrices
Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Lab 10: 3D & Projections Advanced.
Equations of Circles. You can write an equation of a circle in a coordinate plane, if you know: Its radius The coordinates of its center.
MATLAB ® for Engineers, Holly Moore Fourth Edition, Global Edition © Pearson Education Limited 2015 All rights reserved. Figure 5.1 Simple Plot of Time.
More Matlab Graphics and GUI Graphics subplots some useful commands 3D graphics GUI GUI controls The callback property Other essential properties.
An Introduction to Programming in Matlab Emily Blumenthal
1-2 What is the Matlab environment? How can you create vectors ? What does the colon : operator do? How does the use of the built-in linspace function.
EGR 106 – Week 5 – 2-D Plots Question : Why do engineers use plots? Answer : To analyze, visualize, and present data. Matlab has many useful plotting options.
Written by: Itzik Ben Shabat Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Lab.
MATLAB ……………….matrix laboratory. Bhushan D Patil PhD Research Scholar Department of Electrical Engineering Indian Institute of Technology, Bombay Powai,
CS112 Scientific Computation Department of Computer Science Wellesley College Kodak moments 3-D Visualization and Color.
CS112 Scientific Computation Department of Computer Science Wellesley College Kodak moments 3-D Visualization and Color.
John Federici NJIT Physics Department
Computer Application in Engineering Design
3D-Graphs A 3D surface is defined as: z = f(x, y)
Lecture 25.
Ch3 Graphics Overview of Plotting Editing Plots
Two-Dimensional Plots
Use of Mathematics using Technology (Maltlab)
Plotting Data with MATLAB
Introduction to MATLAB Plotting LAB 3
CSCI N317 Computation for Scientific Applications Unit 1 – 5 MATLAB
Create 3D Solid Objects. Create 3D Solid Objects.
Yang-Ming University, Taipei, Taiwan
MATLAB stands for MATrix LABoratory.
Matrix A matrix is a rectangular arrangement of numbers in rows and columns Each number in a matrix is called an Element. The dimensions of a matrix are.
Presentation transcript:

EEE 242 Computer Tools for Electrical Engineering Lecture III Mustafa Karabulut

Lecture III Topics 3D line plots Mesh and surface plots Use of meshgrid to produce 3D points

3D Line Plots

Creating mesh and surface plots About Mesh and Surface Plots You define a surface by the z-coordinates of points above a grid in the x-y plane, using straight lines to connect adjacent points. The mesh and surf plotting functions display surfaces in three dimensions. mesh produces wireframe surfaces that color only the lines connecting the defining points. surf displays both the connecting lines and the faces of the surface in color.

Creating mesh and surface plots Visualizing Functions of Two Variables meshgrid [X,Y] = meshgrid(x,y) [X,Y] = meshgrid(x,y) transforms the domain specified by vectors x and y into arrays X and Y, which can be used to evaluate functions of two variables and three-dimensional mesh/surface plots. The rows of the output array X are copies of the vector x; columns of the output array Y are copies of the vector y.

Creating mesh and surface plots Visualizing Functions of Two Variables meshgrid [X,Y] = meshgrid(1:3,10:14) X = 1 2 3 Y = 10 10 10 11 11 11 12 12 12 13 13 13 14 14 14

Creating mesh and surface plots Visualizing Functions of Two Variables To display a function of two variables, z = f (x,y), Generate X and Y matrices consisting of repeated rows and columns, respectively, over the domain of the function. Use X and Y to evaluate and graph the function. The meshgrid function transforms the domain specified by a single vector or two vectors x and y into matrices X and Y for use in evaluating functions of two variables. The rows of X are copies of the vector x and the columns of Y are copies of the vector y

Creating mesh and surface plots Example — Graphing the sinc Function This example evaluates and graphs the two-dimensional sinc function, sin(r)/r, between the x and y directions. R is the distance from the origin, which is at the center of the matrix. Adding eps (a MATLAB command that returns a small floating-point number) avoids the indeterminate 0/0 at the origin [X,Y] = (-8:.5:8); R = sqrt(X.^2 meshgrid+ Y.^2) + eps; Z = sin(R)./R; mesh(X,Y,Z,'EdgeColor','black')

Creating mesh and surface plots Example — Graphing the sinc Function

Creating mesh and surface plots Example — Colored Surface Plots A surface plot is similar to a mesh plot except that the rectangular faces of the surface are colored. The color of each face is determined by the values of Z and the colormap (a colormap is an ordered list of colors). These statements graph the sinc function as a surface plot, specify a colormap, and add a color bar to show the mapping of data to color surf(X,Y,Z) colormap hsv colorbar

Creating mesh and surface plots Example — Colored Surface Plots

Creating mesh and surface plots Manipulating the Surface The figure toolbar and the camera toolbar provide ways to explore 3-D graphics interactively. Display the camera toolbar by selecting Camera Toolbar from the figure View menu. The following picture shows both toolbars with the Rotate 3D tool selected.

Creating mesh and surface plots Manipulating the Surface

Homework Plot a circle. It’s not immediately obvious how to plot a circle in Matlab. Write the function [x,y]=getCircle(center,r) to get the x and y coordinates of a circle. The circle should be centered at center (2- element vector containing the x and y values of the center) and have radius r. Return x and y such that plot(x,y) will plot the circle. Recall that for a circle at the origin (0,0), the following is true: , x = sin(t) y =cos(t) t= [0, 2π]

Homework Write a script called concentric.m. In this script, open a new figure and plot five circles, all centered at the origin and with increasing radii. Set the line width for each circle to something thick (at least 2 points), and use the colors from a 5-color jet colormap (jet). The property names for line width and color are ‘LineWidth’ and ‘Color’, respectively. Other useful function calls are hold on and axis equal. It should look something like this :

Homework Make a script called olympic.m. This script should use your getCircle function to draw the Olympic logo, as shown below. Don’t worry about making the circles overlap in the same way as the official logo (it’s possible but is too complicated for now). Also, when specifying colors, you can use the same color codes as when plotting lines

End of lecture 3  Thank you for listening See you next week