CHEN 3102 Lecture Notes - Lecture 15: Text Editor, Double-Precision Floating-Point Format, 8-Bit

10 views3 pages

Document Summary

//when we say this, we take the number 3 and put it in the memory spot that corresponds to x. //use semicolon to suppress the output so that you don"t use energy just displaying everything. //take x from the memory to get the 4, add 1, and then put the value back into the x memory. // in matlab, you can just use any variables anytime, but it"s good to declare variables b/c or else, can potentially run into problems. Program x = 0; % initialize x (commentnothing"s read after percent sign) y = 0; % initialize y x = 3; x = 4; x = x + 1; y = x + 1; x. -int8: 8 bit integer => goes to 27 15 is the max. -int16: 16 bit integer => goes to 215 etc. floating point. -double: default in matlab (single or double precision) x = 2:1:10 starts @ 2, increments by 1, and ends at 10.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents