-
Notifications
You must be signed in to change notification settings - Fork 629
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Units,MatLab: new for set and get methods
Tag returned should be get.myproperty f set.myproperty f (@masatake added --sort=no.)
- Loading branch information
Showing
4 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--sort=no | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
input input.m /^classdef input < handle$/;" c | ||
get.myproperty input.m /^ function out=get.myproperty(obj)$/;" f | ||
set.myproperty input.m /^ function out=set.myproperty(obj,val)$/;" f | ||
classfunc1 input.m /^ function [x,y,z] = classfunc1$/;" f | ||
classfunc2 input.m /^ function x = classfunc2()$/;" f | ||
x input.m /^ x = func2(1);$/;" v | ||
classfunc3 input.m /^ function classfunc3;$/;" f | ||
func1 input.m /^function [x,y,z] = func1() % Silly function with multiple outputs$/;" f | ||
x input.m /^ x = 1;$/;" v | ||
y input.m /^ y = 2;$/;" v | ||
z input.m /^ z = 3;$/;" v | ||
func2 input.m /^function x = func2(arg)$/;" f | ||
x input.m /^ x = arg;$/;" v | ||
func3 input.m /^function func3()$/;" f | ||
A input.m /^ A = magic(4);$/;" v | ||
R input.m /^ R = randn(3,4,5);$/;" v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
regex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
classdef input < handle | ||
properties | ||
myproperty | ||
end | ||
properties(Hidden) | ||
myproperty_ | ||
end | ||
function out=get.myproperty(obj) | ||
out=myproperty_; | ||
end | ||
function out=set.myproperty(obj,val) | ||
myproperty_=val; | ||
end | ||
methods(Static) | ||
function [x,y,z] = classfunc1 | ||
[x, y, z] = func1(); | ||
end | ||
function x = classfunc2() | ||
x = func2(1); | ||
end | ||
function classfunc3; | ||
func3(); | ||
end | ||
end | ||
end | ||
|
||
function [x,y,z] = func1() % Silly function with multiple outputs | ||
x = 1; | ||
y = 2; | ||
z = 3; | ||
end | ||
function x = func2(arg) | ||
x = arg; | ||
end | ||
function func3() | ||
% Silly function without any arguments | ||
A = magic(4); | ||
R = randn(3,4,5); | ||
|
||
disp('A:'); | ||
disp(A); | ||
|
||
disp('R:'); | ||
disp(R); | ||
end |