matlab:introduction_to_matlab
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
matlab:introduction_to_matlab [2019/04/26 21:59] – [Higher dimensions] mithat | matlab:introduction_to_matlab [2021/12/07 19:11] (current) – [Documenting functions] mithat | ||
---|---|---|---|
Line 6: | Line 6: | ||
===== What is it? ===== | ===== What is it? ===== | ||
+ | * A // | ||
* A freaking huge, feature filled graphing calculator | * A freaking huge, feature filled graphing calculator | ||
* Comprehensive | * Comprehensive | ||
Line 111: | Line 112: | ||
===== Matrix operations ===== | ===== Matrix operations ===== | ||
- | Assume '' | ||
<code matlab> | <code matlab> | ||
- | r = num * a; % scalar multiplication | + | r = 1.25 * a; % scalar multiplication |
r = a * b; % matrix multiplication | r = a * b; % matrix multiplication | ||
r = a .* b; % elementwise multiplication | r = a .* b; % elementwise multiplication | ||
Line 315: | Line 315: | ||
===== With " | ===== With " | ||
* Minimum syntax: | * Minimum syntax: | ||
- | <file matlab | + | <file matlab |
- | function main | + | function main() |
area1 = traparea(1, 2, 3); | area1 = traparea(1, 2, 3); | ||
disp(area1); | disp(area1); | ||
Line 343: | Line 343: | ||
===== Documenting functions ===== | ===== Documenting functions ===== | ||
* First comment block after first line is used to [[https:// | * First comment block after first line is used to [[https:// | ||
- | * What user sees when she types '' | + | * What user sees when they type '' |
* Only with single-function m-files. | * Only with single-function m-files. | ||
<file matlab traparea.m> | <file matlab traparea.m> |
matlab/introduction_to_matlab.1556315975.txt.gz · Last modified: 2019/04/26 21:59 by mithat