CHEN 3102 Lecture Notes - Lecture 15: Text Editor, Double-Precision Floating-Point Format, 8-Bit
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.