CS 170 – Intro to Scientific and engineering Programming

1 / 10

CS 170 – Intro to Scientific and engineering Programming - PowerPoint PPT Presentation

CS 170 – Intro to Scientific and engineering Programming. Built-in MATLAB functions. math: sum, prod, mean, std , abs, sqrt , sin, cos, abs , exp , min, max logical: any, all, and, or, not creation: linspace , colon, ones, zeros dimensions: size, length

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.

PowerPoint Slideshow about 'CS 170 – Intro to Scientific and engineering Programming' - helen

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

CS 170 – Intro to Scientific and engineering Programming

Built-in MATLAB functions
• math: sum, prod, mean, std, abs, sqrt, sin, cos, abs, exp, min, max
• logical: any, all, and, or, not
• creation: linspace, colon, ones, zeros
• dimensions: size, length
• graph/display: plot, figure, subplot, xlabel, ylabel,
• title, axis, legend, imshow, imtool
• input/output: input, disp
The other side of the contract
• We’ve been using functions built by others - let’s try writing a few of our own
• Implement a myMeanfunction that returns a single value representing the average value of a vector or matrix
Try another one?
• Write a function to draw a circle
• Think first about the contract:
• use inputs to control appearance: radius, location, color, markers, line style, line width
• Call the new function drawCircleand store it in an M-File named drawCircle.m

Questions??

Resources
• Lecture slides CS112, Ellen Hildreth, http://cs.wellesley.edu/~cs112/