Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gdat
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Show more breadcrumbs
SPC
gdat
Commits
e873daa8
Commit
e873daa8
authored
3 years ago
by
Olivier Sauter
Browse files
Options
Downloads
Patches
Plain Diff
update from CHEASEgui
parent
f216757b
No related branches found
Branches containing commit
Tags
crpptbx-9.6.0-deployed-crpptbx-release-v4.3.65
crpptbx-release-v4.3.65
Tags containing commit
1 merge request
!119
update from CHEASEgui
Pipeline
#103849
passed
2 years ago
Stage: test
Stage: post-test
Changes
1
Pipelines
53
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
matlab/iround_os.m
+5
-4
5 additions, 4 deletions
matlab/iround_os.m
with
5 additions
and
4 deletions
matlab/iround_os.m
+
5
−
4
View file @
e873daa8
function
[
is
,
sigi
]
=
iround_os
(
sig
,
val
)
%
% Given two arrays sig and val, for each element in val
% Given two arrays sig and val, for each element in val
% returns the index and value of the nearest element in sig.
%
%
% sig and/or val can be non-monotonic (contrary to TCV iround which requires sig to be monotonic)
%
% Example:
...
...
@@ -11,7 +11,8 @@ function [is,sigi]=iround_os(sig,val)
%
%
%
for
j
=
1
:
length
(
val
)
[
s
(
j
),
is
(
j
)]
=
min
(
abs
(
sig
-
val
(
j
)));
is
=
zeros
(
size
(
val
));
for
j
=
1
:
numel
(
val
)
[
~
,
is
(
j
)]
=
min
(
abs
(
sig
-
val
(
j
)));
end
sigi
=
sig
(
is
);
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