Mercurial > octave
annotate test/classdef/foo_method_changes_property_size.m @ 33658:b1d6e40ac737 stable tip
NEWS.9.md: Fix typo and minor formatting changes.
* etc/NEWS.9.md: Fix typo. Adjust whitespace. Use markdown syntax for code
snippets.
author | Markus Mützel <markus.muetzel@gmx.de> |
---|---|
date | Wed, 05 Jun 2024 11:27:35 +0200 |
parents | ebd2259c5df1 |
children |
rev | line source |
---|---|
15967
24ceda35d146
Add classdef tests for method changing the size of a property.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
1 classdef foo_method_changes_property_size |
24ceda35d146
Add classdef tests for method changing the size of a property.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
2 properties |
24ceda35d146
Add classdef tests for method changing the size of a property.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
3 element; |
24ceda35d146
Add classdef tests for method changing the size of a property.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
4 end |
24ceda35d146
Add classdef tests for method changing the size of a property.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
5 methods |
16049
ebd2259c5df1
Fix classdef tests.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
15967
diff
changeset
|
6 function obj = foo_method_changes_property_size (n) |
15967
24ceda35d146
Add classdef tests for method changing the size of a property.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
7 obj.element = 1:n; |
24ceda35d146
Add classdef tests for method changing the size of a property.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
8 end |
24ceda35d146
Add classdef tests for method changing the size of a property.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
9 function obj = move_element_to_end (obj, n) |
16049
ebd2259c5df1
Fix classdef tests.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
15967
diff
changeset
|
10 obj.element(end+1) = obj.element(n); |
15967
24ceda35d146
Add classdef tests for method changing the size of a property.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
11 obj.element(n) = []; |
24ceda35d146
Add classdef tests for method changing the size of a property.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
12 end |
24ceda35d146
Add classdef tests for method changing the size of a property.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
13 end |
24ceda35d146
Add classdef tests for method changing the size of a property.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
14 end |