Skip to content

Commit

Permalink
新增函数
Browse files Browse the repository at this point in the history
MATLAB.General.Load
MATLAB.Lang.Input
  • Loading branch information
埃博拉酱 committed Sep 27, 2021
1 parent 3d07961 commit ce9e6f7
Show file tree
Hide file tree
Showing 10 changed files with 166 additions and 2 deletions.
Binary file added +MATLAB/+General/Load.mlx
Binary file not shown.
Binary file added +MATLAB/+Lang/Input.mlx
Binary file not shown.
2 changes: 1 addition & 1 deletion +MATLAB/Version.m
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
function V = Version
V.Me='3.2.2';
V.Me='3.3.0';
V.MATLAB='R2021b';
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
- [OrderedDimensionSize2IndexArray](#OrderedDimensionSize2IndexArray) 根据维度顺序和尺寸,生成自定义的下标转线性索引数组
- [OrderedDimensionSize2SubsVectors](#OrderedDimensionSize2SubsVectors) 根据维度顺序和尺寸,生成自定义的线性索引转下标向量
- [+General](#General)
- [Load](#Load) 内置load函数的优化版
- [Save](#Save) 内置save函数的强化版
- [SHFileCopy](#SHFileCopy) 调用Windows文件资源管理器进行文件、目录复制操作,支持批量操作、显示进度、撤销、对话框等高级功能。(仅限Windows)
- [SHFileDelete](#SHFileDelete) 调用Windows文件资源管理器进行文件、目录删除操作,支持批量操作、显示进度、撤销、对话框等高级功能。(仅限Windows)
Expand All @@ -47,6 +48,7 @@
- [+Lang](#Lang)
- [DistributeVararginByValidation](#DistributeVararginByValidation) 根据验证函数将输入的Varargin分发到输出变量
- [GetNthOutputs](#GetNthOutputs) 获取函数的第N个输出
- [Input](#Input) 内置input函数的优化版
- [+Ops](#Ops)
- [IsMember](#IsMember) 支持任意类型输入的ismember
- [Unique](#Unique) 支持任意类型输入的unique
Expand Down Expand Up @@ -576,6 +578,10 @@ ArbitraryOrder(1,:)=1:numel(DimensionSize),希望得到的索引矩阵的维

\[S1,S2,S3, …\]\(1,:\)uint32,下标向量。例如Sk向量在位置I处的值,表示线性索引I对应的第k维下标。
## +General
### Load
内置load函数的增强版,取消适用场合限制

内置load函数无法在参数块中使用,在parfor中使用必须赋予返回值。本函数取消这些限制,且功能完全相同。
### Save
内置save函数的强化版

Expand Down Expand Up @@ -1270,6 +1276,10 @@ OutputIndices(1,:)uint8,要获取的返回值序号。可以排列成向量以
**返回值**

varargout,OutputIndices参数指定位置的Function返回值。
### Input
内置input函数的增强版,取消适用场合限制

内置input函数无法在参数块中使用。本函数取消这些限制,且功能完全相同。
## +Ops
### IsMember
支持任意类型输入的ismember
Expand Down
136 changes: 136 additions & 0 deletions resources/functionSignatures.json
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,117 @@
}
]
},
"MATLAB.General.Load": {
"inputs": [
{
"name": "filename",
"kind": "required",
"type": [
[
"file=*.mat",
"@(x) exist(x,'file')==2||exist([x '.mat'],'file')==2"
],
[
"matlabpathfile=*.mat"
]
]
},
{
"name": "variables",
"kind": "ordered",
"type": [
[
"char",
"choices=matlab.internal.language.introspective.tabcompletion.load_vvariables(filename)"
]
],
"repeating": true
}
],
"outputs": [
{
"name": "S",
"type": [
"struct"
]
}
]
},
"MATLAB.General.Load": {
"inputs": [
{
"name": "filename",
"kind": "required",
"type": [
[
"file",
"@(x) exist(x,'file')==2||exist([x '.mat'],'file')==2"
],
[
"matlabpathfile=*.mat"
]
]
},
{
"name": "'-mat'",
"kind": "ordered",
"type": [
[
"char",
"choices={'-mat'}"
]
]
},
{
"name": "variables",
"kind": "ordered",
"type": [
[
"char",
"choices=matlab.internal.language.introspective.tabcompletion.load_vvariables(filename)"
]
],
"repeating": true
}
],
"outputs": [
{
"name": "S",
"type": [
"struct"
]
}
]
},
"MATLAB.General.Load": {
"inputs": [
{
"name": "filename",
"kind": "required",
"type": [
"file"
]
},
{
"name": "'-ascii'",
"kind": "required",
"type": [
[
"char",
"choices={'-ascii'}"
]
]
}
],
"outputs": [
{
"name": "S",
"type": [
"double"
]
}
]
},
"MATLAB.General.Save": {
"inputs": [
{
Expand Down Expand Up @@ -1600,6 +1711,31 @@
}
]
},
"MATLAB.Lang.Input": {
"inputs": [
{
"name": "prompt",
"kind": "required",
"type": [
[
"string",
"scalar"
],
[
"char",
"vector"
]
],
"purpose": "向用户显示的文本"
},
{
"name": "Flag",
"kind": "flag",
"type": "choices={'s'}",
"purpose": "返回输入的文本,而不会将输入作为表达式来计算"
}
]
},
"MATLAB.Ops.IsMember": {
"inputs": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info>
<Category UUID="FileClassCategory">
<Label UUID="design" />
</Category>
</Info>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info location="Input.mlx" type="File" />
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info>
<Category UUID="FileClassCategory">
<Label UUID="design" />
</Category>
</Info>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info location="Load.mlx" type="File" />
4 changes: 3 additions & 1 deletion 埃博拉酱 的 MATLAB 扩展 Extension.prj
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
- [OrderedDimensionSize2IndexArray](#OrderedDimensionSize2IndexArray) 根据维度顺序和尺寸,生成自定义的下标转线性索引数组
- [OrderedDimensionSize2SubsVectors](#OrderedDimensionSize2SubsVectors) 根据维度顺序和尺寸,生成自定义的线性索引转下标向量
- [+General](#General)
- [Load](#Load) 内置load函数的优化版
- [Save](#Save) 内置save函数的强化版
- [SHFileCopy](#SHFileCopy) 调用Windows文件资源管理器进行文件、目录复制操作,支持批量操作、显示进度、撤销、对话框等高级功能。(仅限Windows)
- [SHFileDelete](#SHFileDelete) 调用Windows文件资源管理器进行文件、目录删除操作,支持批量操作、显示进度、撤销、对话框等高级功能。(仅限Windows)
Expand All @@ -54,6 +55,7 @@
- [+Lang](#Lang)
- [DistributeVararginByValidation](#DistributeVararginByValidation) 根据验证函数将输入的Varargin分发到输出变量
- [GetNthOutputs](#GetNthOutputs) 获取函数的第N个输出
- [Input](#Input) 内置input函数的优化版
- [+Ops](#Ops)
- [IsMember](#IsMember) 支持任意类型输入的ismember
- [Unique](#Unique) 支持任意类型输入的unique
Expand All @@ -71,7 +73,7 @@
- [InstallSupportPackages](#InstallSupportPackages) 安装下载好的支持包
- [SupportPackageDownloader](#SupportPackageDownloader) 下载支持包下载器</param.description>
<param.screenshot>${PROJECT_ROOT}\图标.png</param.screenshot>
<param.version>3.2.2</param.version>
<param.version>3.3.0</param.version>
<param.output>${PROJECT_ROOT}\埃博拉酱 的 MATLAB 扩展 Extension.mltbx</param.output>
<param.products.name>
<item>MATLAB</item>
Expand Down

0 comments on commit ce9e6f7

Please sign in to comment.