software:scilab:linear-algebra
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
software:scilab:linear-algebra [2020/07/28 08:02] – [Matrix] tormec | software:scilab:linear-algebra [2023/05/28 16:37] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Linear algebra ====== | ||
+ | ===== Vector ===== | ||
+ | |||
+ | To define a column vector: | ||
+ | |||
+ | < | ||
+ | v = [1; 2; 3] | ||
+ | </ | ||
+ | |||
+ | To define a row vector, two syntaxes are possible: | ||
+ | |||
+ | <WRAP group> | ||
+ | <WRAP half column> | ||
+ | < | ||
+ | v = [1 2 3] | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | <WRAP half column> | ||
+ | |||
+ | < | ||
+ | v = [1, 2, 3] | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | ===== Matrix ===== | ||
+ | |||
+ | To define a matrix: | ||
+ | |||
+ | < | ||
+ | M = [1 2 3; 4 5 6; 7 8 9] | ||
+ | </ | ||
+ | |||
+ | $$ | ||
+ | \begin{bmatrix} | ||
+ | 1 & 2 & 3 \\ | ||
+ | 4 & 5 & 6 \\ | ||
+ | 7 & 8 & 9 \\ | ||
+ | \end{bmatrix} | ||
+ | $$ | ||
+ | ===== Get element from vector/ | ||
+ | |||
+ | Get element from a vector '' | ||
+ | * to get element in the ''< | ||
+ | |||
+ | Get element from a matrix '' | ||
+ | * to get the element in the ''< | ||
+ | * to get the whole ''< | ||
+ | * to get the whole ''< | ||
+ | * to get the whole ''< | ||
+ | * to get the whole ''< | ||
+ | |||
+ | |||
+ | ===== Data structure ===== | ||
+ | |||
+ | The '' | ||
+ | |||
+ | |||
+ | ===== Create data structure with a loop ===== | ||
+ | |||
+ | < | ||
+ | g = list(" | ||
+ | p = struct() | ||
+ | |||
+ | for i = g | ||
+ | p(i) = i | ||
+ | end | ||
+ | |||
+ | fn = fieldnames(p) | ||
+ | for j = fn' | ||
+ | disp(p(j)) | ||
+ | end | ||
+ | </ |
software/scilab/linear-algebra.txt · Last modified: 2023/05/28 16:37 by 127.0.0.1