This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: CS1372: HELPING TO PUT THE COMPUTING IN ECE CS1372: HELPING TO PUT THE COMPUTING IN ECE CS1372 Matlab vs. C CS1372: HELPING TO PUT THE COMPUTING IN ECE C History • C was written at Bell Labs initially between 1969 and 1973 as a low level systems programming language which could be used instead of assembly language to write operating systems. CS1372: HELPING TO PUT THE COMPUTING IN ECE MATLAB History • MATLAB was developed in the late 1970s at the University of New Mexico. It was designed to give students access to LINPACK and EISPACK without their having to learn Fortran. It was rewritten in C and MathWorks was founded in 1984. In 2000, MATLAB was rewritten to use a newer set of libraries for matrix manipulation, LAPACK. CS1372: HELPING TO PUT THE COMPUTING IN ECE Translation • Interpreted Languages • MATLAB • BASIC • SCHEME • LISP • PYTHON • PERL • JAVA • Compiled Languages • C • C++ • ALGOL • FORTRAN • COBOL • ADA • JAVA CS1372: HELPING TO PUT THE COMPUTING IN ECE Powerful Vector, Array and Matrix Operations • Matlab has a complete set of operators to allow easy creation, manipulation and operation of complex mathematical structures. • C has CS1372: HELPING TO PUT THE COMPUTING IN ECE Variables • Variables in Matlab are actually pointers that can point to anything so • A = 7 may be followed by • A = [1,2;4,5] with no problem • C is a strongly typed language. A variable in C must be declared to be of a certain type and that is all that it can ever be! int A; A = 7; • Although C CS1372: HELPING TO PUT THE COMPUTING IN ECE All variables must be declared in C • C is strongly typed. It demands that you declare a variables type before using it • Variables must be declared at the top! { int a; int b = 34; int c; c = 67; int d; CS1372: HELPING TO PUT THE COMPUTING IN ECE All variables must be declared in C • C is strongly typed. It demands that you declare a variables type before using it • Variables must be declared at the top! { int a; int b = 34; // This is okay! int c; c = 67; // ERROR int d; CS1372: HELPING TO PUT THE COMPUTING IN ECE C does have multidimensional arrays • Just none of the cool built in operators int a[3][4] = { {1,2,3,4}, {5,6,7,8}, {9,10,11,12 }}; • You want to manipulate the array…write some code! CS1372: HELPING TO PUT THE COMPUTING IN ECE Booleans • Matlab can have variables that have values of true and false • There are no booleans in C!!! • When a boolean is required use an int • 0 is FALSE • Anything else is TRUE!!!!! CS1372: HELPING TO PUT THE COMPUTING IN ECE Semicolons • In Matlab the semicolon serves to suppress the output from the line it terminates thus it may be considered optional • In C the semicolon is a critical element...
View
Full Document
 Spring '07
 Smith
 matlab, ASCII, CS1372

Click to edit the document details