
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

27 Aug 2007 MATLAB data types A variable in MATLAB as in most programming languages, comes with three things: a value: a location: and a data type: From the MATLAB help "Overview of Data Types": Which are most important to us? What's the difference between single & double? How do these commands use/change locations, values, & types? ab newvariable = 6.023e a = a + 1 a = 3b (Array operations) brackets [] semicolon ; colon : transpose ' indexing () math + - * / ^ sqrt() sin() sum() round() floor() ceil() array math . ./ .^ rc array creation zeros(r,c) ones(r,c) rand(r,c) graphing/plotting plot() hist() How do you: find how many spots on one die? two dice? 5 dice? throw 5 dice 1000 times and plot the number of spots each time? plot a histogram?