runmat 0.4.9-dev.1 → 0.4.9-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/artifacts/stdlib.snapshot +0 -0
- package/dist/generated/builtin-examples-catalog.d.ts.map +1 -1
- package/dist/generated/builtin-examples-catalog.js +1 -1
- package/dist/generated/builtin-examples-catalog.js.map +1 -1
- package/dist/generated/builtins/fgetl.d.ts +4 -0
- package/dist/generated/builtins/fgetl.d.ts.map +1 -0
- package/dist/generated/builtins/fgetl.js +133 -0
- package/dist/generated/builtins/fgetl.js.map +1 -0
- package/dist/generated/builtins/fgets.d.ts.map +1 -1
- package/dist/generated/builtins/fgets.js +4 -0
- package/dist/generated/builtins/fgets.js.map +1 -1
- package/dist/generated/builtins/impulse.d.ts +4 -0
- package/dist/generated/builtins/impulse.d.ts.map +1 -0
- package/dist/generated/builtins/impulse.js +123 -0
- package/dist/generated/builtins/impulse.js.map +1 -0
- package/dist/generated/builtins-manifest.d.ts.map +1 -1
- package/dist/generated/builtins-manifest.js +40 -0
- package/dist/generated/builtins-manifest.js.map +1 -1
- package/dist/lsp/runmat_lsp.d.ts +2 -2
- package/dist/lsp/runmat_lsp.js +4 -4
- package/dist/lsp/runmat_lsp_bg.wasm +0 -0
- package/dist/lsp/runmat_lsp_bg.wasm.d.ts +2 -2
- package/dist/pkg-web/runmat_wasm_web.d.ts +3 -3
- package/dist/pkg-web/runmat_wasm_web.js +7 -7
- package/dist/pkg-web/runmat_wasm_web_bg.wasm +0 -0
- package/dist/pkg-web/runmat_wasm_web_bg.wasm.d.ts +3 -3
- package/dist/runtime/stdlib.snapshot +0 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fgetl.d.ts","sourceRoot":"","sources":["../../../src/generated/builtins/fgetl.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,QAAA,MAAM,UAAU,EAAE,UAgIjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
// @generated by scripts/generate-builtins.cjs
|
|
2
|
+
// Do not edit by hand.
|
|
3
|
+
const builtinDoc = {
|
|
4
|
+
"title": "fgetl",
|
|
5
|
+
"category": "io/filetext",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"fgetl",
|
|
8
|
+
"text file",
|
|
9
|
+
"line input",
|
|
10
|
+
"newline"
|
|
11
|
+
],
|
|
12
|
+
"summary": "Read the next line from a file, removing newline characters from the result.",
|
|
13
|
+
"references": [
|
|
14
|
+
"https://www.mathworks.com/help/matlab/ref/fgetl.html"
|
|
15
|
+
],
|
|
16
|
+
"gpu_support": {
|
|
17
|
+
"elementwise": false,
|
|
18
|
+
"reduction": false,
|
|
19
|
+
"precisions": [],
|
|
20
|
+
"broadcasting": "none",
|
|
21
|
+
"notes": "Runs entirely on the host CPU. When the file identifier lives on the GPU, RunMat gathers it before performing host I/O."
|
|
22
|
+
},
|
|
23
|
+
"fusion": {
|
|
24
|
+
"elementwise": false,
|
|
25
|
+
"reduction": false,
|
|
26
|
+
"max_inputs": 1,
|
|
27
|
+
"constants": "inline"
|
|
28
|
+
},
|
|
29
|
+
"requires_feature": null,
|
|
30
|
+
"tested": {
|
|
31
|
+
"unit": "builtins::io::filetext::fgetl::tests"
|
|
32
|
+
},
|
|
33
|
+
"description": "`fgetl(fid)` returns the next line from the text file associated with `fid`, removing any line terminator from the returned character row vector. It mirrors MATLAB's end-of-file sentinel and file-position semantics so line-oriented scripts can distinguish real empty lines from EOF.",
|
|
34
|
+
"behaviors": [
|
|
35
|
+
"`tline = fgetl(fid)` reads from the current file position to the next line terminator or to end-of-file when no terminator is found.",
|
|
36
|
+
"Line terminators are consumed but not included in the returned character row vector. RunMat recognises `\\n`, `\\r\\n`, and `\\r`.",
|
|
37
|
+
"When the file is empty or the file position indicator is already at end-of-file, `fgetl` returns the numeric sentinel `-1`.",
|
|
38
|
+
"An empty line returns an empty character row vector, not `-1`.",
|
|
39
|
+
"Lines are decoded using the text encoding recorded by `fopen`. UTF-8, US-ASCII, ISO-8859-1 (`latin1`), Windows-1252, Shift_JIS, and binary mode are recognised without additional user work."
|
|
40
|
+
],
|
|
41
|
+
"examples": [
|
|
42
|
+
{
|
|
43
|
+
"description": "Read the first line of a file without the newline",
|
|
44
|
+
"input": "% Browser sandbox: you must be logged in\n% to save files for this example.\nfname = tempname;\nfid = fopen(fname, 'w');\nfprintf(fid, 'RunMat\\nSecond line\\n');\nfclose(fid);\n\nfid = fopen(fname, 'r');\nline = fgetl(fid);\nfclose(fid);\ndelete(fname);\n\nline",
|
|
45
|
+
"output": "line =\n 'RunMat'"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"description": "Read a file line by line",
|
|
49
|
+
"input": "% Browser sandbox: you must be logged in\n% to save files for this example.\nfname = tempname;\nfid = fopen(fname, 'w');\nfprintf(fid, 'one\\n');\nfprintf(fid, 'two\\n');\nfclose(fid);\n\nfid = fopen(fname, 'r');\ntline = fgetl(fid);\nwhile tline ~= -1\n disp(tline);\n tline = fgetl(fid);\nend\nfclose(fid);\ndelete(fname)",
|
|
50
|
+
"output": "one\ntwo"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"description": "Distinguish an empty line from end of file",
|
|
54
|
+
"input": "% Browser sandbox: you must be logged in\n% to save files for this example.\nfname = tempname;\nfid = fopen(fname, 'w');\nfprintf(fid, '\\nlast');\nfclose(fid);\n\nfid = fopen(fname, 'r');\nline1 = fgetl(fid);\nline2 = fgetl(fid);\nline3 = fgetl(fid);\nfclose(fid);\ndelete(fname);\n\nisempty(line1)\nline2\nline3",
|
|
55
|
+
"output": "ans =\n logical\n 1\nline2 =\n 'last'\nline3 =\n -1"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"description": "Read a final line without a trailing newline",
|
|
59
|
+
"input": "% Browser sandbox: you must be logged in\n% to save files for this example.\nfname = tempname;\nfid = fopen(fname, 'w');\nfprintf(fid, 'last line');\nfclose(fid);\n\nfid = fopen(fname, 'r');\nline1 = fgetl(fid);\nline2 = fgetl(fid);\nfclose(fid);\ndelete(fname);\n\nline1\nline2",
|
|
60
|
+
"output": "line1 =\n 'last line'\nline2 =\n -1"
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
"faqs": [
|
|
64
|
+
{
|
|
65
|
+
"question": "What does `fgetl` return at end-of-file?",
|
|
66
|
+
"answer": "When no characters can be read because the file position indicator is at end-of-file, `fgetl` returns the numeric value `-1`."
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"question": "How does `fgetl` differ from `fgets`?",
|
|
70
|
+
"answer": "`fgetl` removes newline characters from the returned line, while `fgets` keeps them. Use `fgetl` for newline-free line processing and `fgets` when terminator bytes matter."
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"question": "What happens for a blank line?",
|
|
74
|
+
"answer": "A blank line returns an empty character row vector. Only EOF before any characters are read returns `-1`."
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"question": "Can I call `fgetl` on files opened for writing only?",
|
|
78
|
+
"answer": "No. The file must be opened with read permission (for example `'r'`, `'r+'`, or `'w+'`). Calling `fgetl` on a write-only identifier raises an error."
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
"links": [
|
|
82
|
+
{
|
|
83
|
+
"label": "fopen",
|
|
84
|
+
"url": "./fopen"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"label": "fclose",
|
|
88
|
+
"url": "./fclose"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"label": "feof",
|
|
92
|
+
"url": "./feof"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"label": "fgets",
|
|
96
|
+
"url": "./fgets"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"label": "fread",
|
|
100
|
+
"url": "./fread"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"label": "fileread",
|
|
104
|
+
"url": "./fileread"
|
|
105
|
+
}
|
|
106
|
+
],
|
|
107
|
+
"source": {
|
|
108
|
+
"label": "crates/runmat-runtime/src/builtins/io/filetext/fgetl.rs",
|
|
109
|
+
"url": "crates/runmat-runtime/src/builtins/io/filetext/fgetl.rs"
|
|
110
|
+
},
|
|
111
|
+
"syntax": {
|
|
112
|
+
"example": {
|
|
113
|
+
"description": "Syntax",
|
|
114
|
+
"input": "line = fgetl(fileID)"
|
|
115
|
+
},
|
|
116
|
+
"points": [
|
|
117
|
+
"`fileID` is a file handle returned by `fopen`. The file must be opened with read permission (`'r'`, `'r+'`, `'w+'`, or `'a+'`).",
|
|
118
|
+
"`line` is a character row vector without the trailing line terminator. When the file position is already at end-of-file, `fgetl` returns the numeric sentinel `-1`."
|
|
119
|
+
]
|
|
120
|
+
},
|
|
121
|
+
"gpu_behavior": [
|
|
122
|
+
"`fgetl` is a host-only operation. File identifiers live in the host registry created by `fopen`, so GPU-resident scalar arguments are gathered back to the CPU before the read occurs."
|
|
123
|
+
],
|
|
124
|
+
"key": "fgetl",
|
|
125
|
+
"slug": "fgetl",
|
|
126
|
+
"aliases": [],
|
|
127
|
+
"categoryPath": [
|
|
128
|
+
"io",
|
|
129
|
+
"filetext"
|
|
130
|
+
]
|
|
131
|
+
};
|
|
132
|
+
export default builtinDoc;
|
|
133
|
+
//# sourceMappingURL=fgetl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fgetl.js","sourceRoot":"","sources":["../../../src/generated/builtins/fgetl.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,uBAAuB;AAIvB,MAAM,UAAU,GAAe;IAC7B,OAAO,EAAE,OAAO;IAChB,UAAU,EAAE,aAAa;IACzB,UAAU,EAAE;QACV,OAAO;QACP,WAAW;QACX,YAAY;QACZ,SAAS;KACV;IACD,SAAS,EAAE,8EAA8E;IACzF,YAAY,EAAE;QACZ,s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EAAE,QAAQ;YACjB,KAAK,EAAE,UAAU;SAClB;QACD;YACE,OAAO,EAAE,MAAM;YACf,KAAK,EAAE,QAAQ;SAChB;QACD;YACE,OAAO,EAAE,OAAO;YAChB,KAAK,EAAE,SAAS;SACjB;QACD;YACE,OAAO,EAAE,OAAO;YAChB,KAAK,EAAE,SAAS;SACjB;QACD;YACE,OAAO,EAAE,UAAU;YACnB,KAAK,EAAE,YAAY;SACpB;KACF;IACD,QAAQ,EAAE;QACR,OAAO,EAAE,yDAAyD;QAClE,KAAK,EAAE,yDAAyD;KACjE;IACD,QAAQ,EAAE;QACR,SAAS,EAAE;YACT,aAAa,EAAE,QAAQ;YACvB,OAAO,EAAE,sBAAsB;SAChC;QACD,QAAQ,EAAE;YACR,iIAAiI;YACjI,qKAAqK;SACtK;KACF;IACD,cAAc,EAAE;QACd,wLAAwL;KACzL;IACD,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,OAAO;IACf,SAAS,EAAE,EAAE;IACb,cAAc,EAAE;QACd,IAAI;QACJ,UAAU;KACX;CACF,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fgets.d.ts","sourceRoot":"","sources":["../../../src/generated/builtins/fgets.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,QAAA,MAAM,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"fgets.d.ts","sourceRoot":"","sources":["../../../src/generated/builtins/fgets.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,QAAA,MAAM,UAAU,EAAE,UAoLjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fgets.js","sourceRoot":"","sources":["../../../src/generated/builtins/fgets.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,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;IACD,QAAQ,EAAE;QACR,OAAO,EAAE,yDAAyD;QAClE,KAAK,EAAE,yDAAyD;KACjE;IACD,QAAQ,EAAE;QACR,SAAS,EAAE;YACT,aAAa,EAAE,QAAQ;YACvB,OAAO,EAAE,+EAA+E;SACzF;QACD,QAAQ,EAAE;YACR,iIAAiI;YACjI,uJAAuJ;YACvJ,uLAAuL;YACvL,mMAAmM;SACpM;KACF;IACD,cAAc,EAAE;QACd,+SAA+S;KAChT;IACD,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,OAAO;IACf,SAAS,EAAE,EAAE;IACb,cAAc,EAAE;QACd,IAAI;QACJ,UAAU;KACX;CACF,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"fgets.js","sourceRoot":"","sources":["../../../src/generated/builtins/fgets.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,uBAAuB;AAIvB,MAAM,UAAU,GAAe;IAC7B,OAAO,EAAE,OAAO;IAChB,UAAU,EAAE,aAAa;IACzB,UAAU,EAAE;QACV,OAAO;QACP,WAAW;QACX,YAAY;QACZ,SAAS;KACV;IACD,SAAS,EAAE,2EAA2E;IACtF,YAAY,EAAE;QACZ,sDAAsD;KACvD;IACD,aAAa,EAAE;QACb,aAAa,EAAE,KAAK;QACpB,WAAW,EAAE,KAAK;QAClB,YAAY,EAAE,EAAE;QAChB,cAAc,EAAE,MAAM;QACtB,OAAO,EAAE,gHAAgH;KAC1H;IACD,QAAQ,EAAE;QACR,aAAa,EAAE,KAAK;QACpB,WAAW,EAAE,KAAK;QAClB,YAAY,EAAE,CAAC;QACf,WAAW,EAAE,QAAQ;KACtB;IACD,kBAAkB,EAAE,IAAI;IACxB,QAAQ,EAAE;QACR,MAAM,EAAE,sCAAsC;KAC/C;IACD,aAAa,EAAE,sSAAsS;IACrT,WAAW,EAAE;QACX,4NAA4N;QAC5N,gSAAgS;QAChS,4PAA4P;QAC5P,mIAAmI;QACnI,8LAA8L;KAC/L;IACD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;KACF;IACD,OAAO,EAAE;QACP;YACE,OAAO,EAAE,OAAO;YAChB,KAAK,EAAE,SAAS;SACjB;QACD;YACE,OAAO,EAAE,QAAQ;YACjB,KAAK,EAAE,UAAU;SAClB;QACD;YACE,OAAO,EAAE,MAAM;YACf,KAAK,EAAE,QAAQ;SAChB;QACD;YACE,OAAO,EAAE,OAAO;YAChB,KAAK,EAAE,SAAS;SACjB;QACD;YACE,OAAO,EAAE,OAAO;YAChB,KAAK,EAAE,SAAS;SACjB;QACD;YACE,OAAO,EAAE,UAAU;YACnB,KAAK,EAAE,YAAY;SACpB;QACD;YACE,OAAO,EAAE,WAAW;YACpB,KAAK,EAAE,aAAa;SACrB;QACD;YACE,OAAO,EAAE,SAAS;YAClB,KAAK,EAAE,WAAW;SACnB;QACD;YACE,OAAO,EAAE,SAAS;YAClB,KAAK,EAAE,WAAW;SACnB;QACD;YACE,OAAO,EAAE,QAAQ;YACjB,KAAK,EAAE,UAAU;SAClB;KACF;IACD,QAAQ,EAAE;QACR,OAAO,EAAE,yDAAyD;QAClE,KAAK,EAAE,yDAAyD;KACjE;IACD,QAAQ,EAAE;QACR,SAAS,EAAE;YACT,aAAa,EAAE,QAAQ;YACvB,OAAO,EAAE,+EAA+E;SACzF;QACD,QAAQ,EAAE;YACR,iIAAiI;YACjI,uJAAuJ;YACvJ,uLAAuL;YACvL,mMAAmM;SACpM;KACF;IACD,cAAc,EAAE;QACd,+SAA+S;KAChT;IACD,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,OAAO;IACf,SAAS,EAAE,EAAE;IACb,cAAc,EAAE;QACd,IAAI;QACJ,UAAU;KACX;CACF,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"impulse.d.ts","sourceRoot":"","sources":["../../../src/generated/builtins/impulse.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,QAAA,MAAM,UAAU,EAAE,UAsHjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
// @generated by scripts/generate-builtins.cjs
|
|
2
|
+
// Do not edit by hand.
|
|
3
|
+
const builtinDoc = {
|
|
4
|
+
"title": "impulse",
|
|
5
|
+
"category": "control",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"impulse",
|
|
8
|
+
"impulse response",
|
|
9
|
+
"control system",
|
|
10
|
+
"transfer function",
|
|
11
|
+
"tf"
|
|
12
|
+
],
|
|
13
|
+
"summary": "Compute or plot the impulse response of supported dynamic system models.",
|
|
14
|
+
"references": [
|
|
15
|
+
"title: \"MATLAB impulse documentation\"",
|
|
16
|
+
"title: \"Octave control package impulse documentation\""
|
|
17
|
+
],
|
|
18
|
+
"gpu_support": {
|
|
19
|
+
"elementwise": false,
|
|
20
|
+
"reduction": false,
|
|
21
|
+
"precisions": [],
|
|
22
|
+
"broadcasting": "none",
|
|
23
|
+
"notes": "`impulse` evaluates host-side control-system metadata and returns host-resident response vectors."
|
|
24
|
+
},
|
|
25
|
+
"fusion": {
|
|
26
|
+
"elementwise": false,
|
|
27
|
+
"reduction": false,
|
|
28
|
+
"max_inputs": 0,
|
|
29
|
+
"constants": "inline",
|
|
30
|
+
"notes": "`impulse` simulates a dynamic system response and terminates fusion chains."
|
|
31
|
+
},
|
|
32
|
+
"requires_feature": null,
|
|
33
|
+
"tested": {
|
|
34
|
+
"unit": "builtins::control::impulse::tests",
|
|
35
|
+
"integration": "crates/runmat-vm/tests/control.rs"
|
|
36
|
+
},
|
|
37
|
+
"description": "`impulse(sys)` computes the impulse response for real, strictly proper, scalar-input scalar-output `tf` objects. With output arguments it returns numeric response data; when called in a no-output context and plotting is available, it plots the response.",
|
|
38
|
+
"behaviors": [
|
|
39
|
+
"Supports real SISO `tf` objects created by `tf(num, den)` or `tf(num, den, Ts)`.",
|
|
40
|
+
"`impulse(sys)` uses a deterministic default time vector.",
|
|
41
|
+
"`impulse(sys, tFinal)` generates a deterministic time vector from zero to `tFinal`.",
|
|
42
|
+
"`impulse(sys, t)` respects an explicit real, finite, non-negative, strictly increasing time vector.",
|
|
43
|
+
"`[y, t] = impulse(...)` returns `y` and `t` as `N x 1` column vectors for supported SISO systems.",
|
|
44
|
+
"Continuous-time responses are evaluated from a controllable canonical state-space realization.",
|
|
45
|
+
"Discrete-time responses respect MATLAB's unit-area impulse convention: the input pulse has height `1/Ts`, and time vectors must use integer multiples of `Ts`.",
|
|
46
|
+
"Unsupported model classes, delays, complex coefficients, static gains, and non-strictly-proper transfer functions raise clear diagnostics."
|
|
47
|
+
],
|
|
48
|
+
"examples": [
|
|
49
|
+
{
|
|
50
|
+
"description": "Compute a first-order impulse response",
|
|
51
|
+
"input": "H = tf(20, [1 5]);\nt = 0:0.1:1;\n[y, tout] = impulse(H, t);",
|
|
52
|
+
"output": "y and tout are column vectors."
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"description": "Plot an impulse response",
|
|
56
|
+
"input": "H = tf(1, [1 3 2]);\nimpulse(H);"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"description": "Discrete-time impulse response",
|
|
60
|
+
"input": "H = tf(1, [1 -0.5], 0.1);\n[y, t] = impulse(H, 0:0.1:0.5);"
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
"faqs": [
|
|
64
|
+
{
|
|
65
|
+
"question": "Does `impulse` support MIMO systems?",
|
|
66
|
+
"answer": "Not yet. The current implementation supports real SISO `tf` objects. Broader model-family and MIMO support is tracked separately."
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"question": "Why are non-strictly-proper transfer functions rejected?",
|
|
70
|
+
"answer": "Those systems include a direct impulse term that is not represented as a finite numeric response vector in the current runtime model."
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"question": "Can I use state-space or zero-pole-gain models?",
|
|
74
|
+
"answer": "Not yet. `ss`, `zpk`, `frd`, model arrays, and identified-system families are outside this first implementation."
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
"links": [
|
|
78
|
+
{
|
|
79
|
+
"label": "tf",
|
|
80
|
+
"url": "./tf"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"label": "plot",
|
|
84
|
+
"url": "./plot"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"label": "stem",
|
|
88
|
+
"url": "./stem"
|
|
89
|
+
}
|
|
90
|
+
],
|
|
91
|
+
"source": {
|
|
92
|
+
"label": "`crates/runmat-runtime/src/builtins/control/impulse.rs`",
|
|
93
|
+
"url": "https://github.com/runmat-org/runmat/blob/main/crates/runmat-runtime/src/builtins/control/impulse.rs"
|
|
94
|
+
},
|
|
95
|
+
"syntax": {
|
|
96
|
+
"example": {
|
|
97
|
+
"description": "Supported forms",
|
|
98
|
+
"input": "impulse(sys)\ny = impulse(sys)\n[y, t] = impulse(sys)\n[y, t] = impulse(sys, tFinal)\n[y, t] = impulse(sys, t)",
|
|
99
|
+
"output": "Response data is returned when outputs are requested; otherwise a plot is produced when plotting support is available."
|
|
100
|
+
},
|
|
101
|
+
"points": [
|
|
102
|
+
"`sys` must currently be a real, strictly proper SISO `tf` object.",
|
|
103
|
+
"`tFinal` must be a finite non-negative scalar.",
|
|
104
|
+
"`t` must be a real vector of finite non-negative strictly increasing times. For discrete systems, values must be integer multiples of `sys.Ts`."
|
|
105
|
+
]
|
|
106
|
+
},
|
|
107
|
+
"validation": {
|
|
108
|
+
"summary": "`impulse` validates the model class, coefficient type and shape, delay properties, strict properness, sample time, and time vector before simulation. Tests cover SISO continuous response values, discrete response values, explicit time input, multi-output shapes, and representative diagnostics.",
|
|
109
|
+
"implementation": {
|
|
110
|
+
"label": "`crates/runmat-runtime/src/builtins/control/impulse.rs`",
|
|
111
|
+
"url": "https://github.com/runmat-org/runmat/blob/main/crates/runmat-runtime/src/builtins/control/impulse.rs"
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
"gpu_residency": "`impulse` returns host-resident response vectors. It does not preserve gpuArray residency.",
|
|
115
|
+
"key": "impulse",
|
|
116
|
+
"slug": "impulse",
|
|
117
|
+
"aliases": [],
|
|
118
|
+
"categoryPath": [
|
|
119
|
+
"control"
|
|
120
|
+
]
|
|
121
|
+
};
|
|
122
|
+
export default builtinDoc;
|
|
123
|
+
//# sourceMappingURL=impulse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"impulse.js","sourceRoot":"","sources":["../../../src/generated/builtins/impulse.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,uBAAuB;AAIvB,MAAM,UAAU,GAAe;IAC7B,OAAO,EAAE,SAAS;IAClB,UAAU,EAAE,SAAS;IACrB,UAAU,EAAE;QACV,SAAS;QACT,kBAAkB;QAClB,gBAAgB;QAChB,mBAAmB;QACnB,IAAI;KACL;IACD,SAAS,EAAE,0EAA0E;IACrF,YAAY,EAAE;QACZ,yCAAyC;QACzC,yDAAyD;KAC1D;IACD,aAAa,EAAE;QACb,aAAa,EAAE,KAAK;QACpB,WAAW,EAAE,KAAK;QAClB,YAAY,EAAE,EAAE;QAChB,cAAc,EAAE,MAAM;QACtB,OAAO,EAAE,mGAAmG;KAC7G;IACD,QAAQ,EAAE;QACR,aAAa,EAAE,KAAK;QACpB,WAAW,EAAE,KAAK;QAClB,YAAY,EAAE,CAAC;QACf,WAAW,EAAE,QAAQ;QACrB,OAAO,EAAE,6EAA6E;KACvF;IACD,kBAAkB,EAAE,IAAI;IACxB,QAAQ,EAAE;QACR,MAAM,EAAE,mCAAmC;QAC3C,aAAa,EAAE,mCAAmC;KACnD;IACD,aAAa,EAAE,+PAA+P;IAC9Q,WAAW,EAAE;QACX,kFAAkF;QAClF,0DAA0D;QAC1D,qFAAqF;QACrF,qGAAqG;QACrG,mGAAmG;QACnG,gGAAgG;QAChG,gKAAgK;QAChK,4IAA4I;KAC7I;IACD,UAAU,EAAE;QACV;YACE,aAAa,EAAE,wCAAw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ts","sourceRoot":"","sources":["../../src/generated/builtins-manifest.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAE7E,eAAO,MAAM,eAAe,EAAE,oBAAoB,
|
|
1
|
+
{"version":3,"file":"builtins-manifest.d.ts","sourceRoot":"","sources":["../../src/generated/builtins-manifest.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAE7E,eAAO,MAAM,eAAe,EAAE,oBAAoB,EA47PjD,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAmZ9D,CAAC;AAEF,eAAO,MAAM,4BAA4B,sEAC0C,CAAC"}
|
|
@@ -2046,6 +2046,25 @@ export const builtinManifest = [
|
|
|
2046
2046
|
"summary": "Shift zero-frequency components to the center of a spectrum.",
|
|
2047
2047
|
"exampleCount": 5
|
|
2048
2048
|
},
|
|
2049
|
+
{
|
|
2050
|
+
"key": "fgetl",
|
|
2051
|
+
"title": "fgetl",
|
|
2052
|
+
"slug": "fgetl",
|
|
2053
|
+
"aliases": [],
|
|
2054
|
+
"category": "io/filetext",
|
|
2055
|
+
"categoryPath": [
|
|
2056
|
+
"io",
|
|
2057
|
+
"filetext"
|
|
2058
|
+
],
|
|
2059
|
+
"keywords": [
|
|
2060
|
+
"fgetl",
|
|
2061
|
+
"text file",
|
|
2062
|
+
"line input",
|
|
2063
|
+
"newline"
|
|
2064
|
+
],
|
|
2065
|
+
"summary": "Read the next line from a file, removing newline characters from the result.",
|
|
2066
|
+
"exampleCount": 4
|
|
2067
|
+
},
|
|
2049
2068
|
{
|
|
2050
2069
|
"key": "fgets",
|
|
2051
2070
|
"title": "fgets",
|
|
@@ -3301,6 +3320,25 @@ export const builtinManifest = [
|
|
|
3301
3320
|
"summary": "Filter images or N-D arrays with correlation/convolution kernels and configurable padding.",
|
|
3302
3321
|
"exampleCount": 5
|
|
3303
3322
|
},
|
|
3323
|
+
{
|
|
3324
|
+
"key": "impulse",
|
|
3325
|
+
"title": "impulse",
|
|
3326
|
+
"slug": "impulse",
|
|
3327
|
+
"aliases": [],
|
|
3328
|
+
"category": "control",
|
|
3329
|
+
"categoryPath": [
|
|
3330
|
+
"control"
|
|
3331
|
+
],
|
|
3332
|
+
"keywords": [
|
|
3333
|
+
"impulse",
|
|
3334
|
+
"impulse response",
|
|
3335
|
+
"control system",
|
|
3336
|
+
"transfer function",
|
|
3337
|
+
"tf"
|
|
3338
|
+
],
|
|
3339
|
+
"summary": "Compute or plot the impulse response of supported dynamic system models.",
|
|
3340
|
+
"exampleCount": 3
|
|
3341
|
+
},
|
|
3304
3342
|
{
|
|
3305
3343
|
"key": "imread",
|
|
3306
3344
|
"title": "imread",
|
|
@@ -8189,6 +8227,7 @@ export const builtinDocLoaders = {
|
|
|
8189
8227
|
"fft": () => import("./builtins/fft.js").then((mod) => mod.default),
|
|
8190
8228
|
"fft2": () => import("./builtins/fft2.js").then((mod) => mod.default),
|
|
8191
8229
|
"fftshift": () => import("./builtins/fftshift.js").then((mod) => mod.default),
|
|
8230
|
+
"fgetl": () => import("./builtins/fgetl.js").then((mod) => mod.default),
|
|
8192
8231
|
"fgets": () => import("./builtins/fgets.js").then((mod) => mod.default),
|
|
8193
8232
|
"fieldnames": () => import("./builtins/fieldnames.js").then((mod) => mod.default),
|
|
8194
8233
|
"figure": () => import("./builtins/figure.js").then((mod) => mod.default),
|
|
@@ -8251,6 +8290,7 @@ export const builtinDocLoaders = {
|
|
|
8251
8290
|
"image": () => import("./builtins/image.js").then((mod) => mod.default),
|
|
8252
8291
|
"imagesc": () => import("./builtins/imagesc.js").then((mod) => mod.default),
|
|
8253
8292
|
"imfilter": () => import("./builtins/imfilter.js").then((mod) => mod.default),
|
|
8293
|
+
"impulse": () => import("./builtins/impulse.js").then((mod) => mod.default),
|
|
8254
8294
|
"imread": () => import("./builtins/imread.js").then((mod) => mod.default),
|
|
8255
8295
|
"imshow": () => import("./builtins/imshow.js").then((mod) => mod.default),
|
|
8256
8296
|
"ind2rgb": () => import("./builtins/ind2rgb.js").then((mod) => mod.default),
|