Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
inPhase code repository
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor 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
fritsch
inPhase code repository
Commits
0782e393
Commit
0782e393
authored
2 years ago
by
fritsch
Browse files
Options
Downloads
Patches
Plain Diff
Upload New File
parent
11d8ad95
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Image segmentation/getDataAllFields.m
+24
-0
24 additions, 0 deletions
Image segmentation/getDataAllFields.m
with
24 additions
and
0 deletions
Image segmentation/getDataAllFields.m
0 → 100644
+
24
−
0
View file @
0782e393
function
dataOut
=
getDataAllFields
(
structInput
,
varNameInput
)
% dataOut = getDataAllFields(structInput, varNameInput)
% compiles all data found under varNameInput into one output container
% Find the variable that is requested
fieldNames1
=
fieldnames
(
structInput
);
fieldNames2
=
fieldnames
(
structInput
.
(
fieldNames1
{
1
}));
for
ii
=
1
:
numel
(
fieldNames2
)
ActDataNames
=
fieldnames
(
structInput
.
(
fieldNames1
{
1
})
.
(
fieldNames2
{
ii
}));
NamePos
=
strcmp
(
ActDataNames
,
varNameInput
);
if
sum
(
NamePos
)
==
1
IdxDataSet
=
ii
;
end
end
% Compile output data
for
ii
=
1
:
numel
(
fieldNames1
)
currField
=
fieldNames1
{
ii
};
dataOut
{
ii
}
=
structInput
.
(
currField
)
.
(
fieldNames2
{
IdxDataSet
})
.
(
varNameInput
);
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