Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
utils
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
GitLab upgrade completed. Current version is 17.11.3.
Show more breadcrumbs
LightFieldCodingLibrary
utils
Commits
adb045d1
Commit
adb045d1
authored
6 years ago
by
DIB Elian
Browse files
Options
Downloads
Patches
Plain Diff
Added function to compute triangular mesh from grid
parent
0e0091cb
Branches
main
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
triangulation.m
+45
-0
45 additions, 0 deletions
triangulation.m
with
45 additions
and
0 deletions
triangulation.m
0 → 100644
+
45
−
0
View file @
adb045d1
function
varargout
=
triangulation
(
X
,
Y
,
varargin
)
%TRIANGULATION Summary of this function goes here
% Detailed explanation goes here
p
=
inputParser
();
p
.
addOptional
(
'Z'
,
[]
,
@
isnumeric
);
p
.
addOptional
(
'order'
,
'none'
,
@
ischar
);
p
.
addOptional
(
'fun'
,
@
(
x
)
min
(
x
,[],
2
));
p
.
parse
(
varargin
{:});
Z
=
p
.
Results
.
Z
;
order
=
p
.
Results
.
order
;
fun
=
p
.
Results
.
fun
;
sz
=
size
(
X
);
[
X_
,
Y_
]
=
ndgrid
(
1
:(
sz
(
1
)
-
1
),
1
:(
sz
(
2
)
-
1
));
TX
=
reshape
(
(
X_
(:)
+
[
0
,
1
,
0
,
1
,
0
,
1
])
' ,3,[])'
;
TY
=
reshape
(
(
Y_
(:)
+
[
0
,
0
,
1
,
1
,
1
,
0
])
' ,3,[])'
;
T
=
sub2ind
(
sz
,
TX
,
TY
);
switch
order
case
'none'
I
=
(
1
:
size
(
T
,
1
))
'
;
otherwise
Z_
=
Z
(
T
);
Z_
=
fun
(
Z_
);
[
~
,
I
]
=
sort
(
Z_
,
order
);
T
=
T
(
I
,:);
end
if
nargout
>
0
varargout
{
1
}
=
triangulation
(
T
,
X
(:),
Y
(:));
end
if
nargout
>
1
varargout
{
2
}
=
I
;
end
if
nargout
>
2
varargout
{
3
}
=
triangulation
(
T
,
X
(:),
Y
(:),
Z
(:));
end
end
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment