Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
artoa4argo
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
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
argoTools
artoa4argo
Commits
687feef4
Commit
687feef4
authored
5 years ago
by
leprob001
Browse files
Options
Downloads
Patches
Plain Diff
Added support to extract soundsources from struct as either struct or cell.
parent
13c281ba
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
lib/+artoa/+data/extractSoundsourcesFromStruct.m
+22
-1
22 additions, 1 deletion
lib/+artoa/+data/extractSoundsourcesFromStruct.m
with
22 additions
and
1 deletion
lib/+artoa/+data/extractSoundsourcesFromStruct.m
+
22
−
1
View file @
687feef4
function
[
extractedSoundsources
]
=
extractSoundsourcesFromStruct
(
pSourcesToExtract
,
pSoundsources
)
function
[
extractedSoundsources
]
=
extractSoundsourcesFromStruct
(
pSourcesToExtract
,
pSoundsources
,
pAsStruct
)
%EXTRACTSOUNDSOURCESFROMARRAY Summary of this function goes here
% Detailed explanation goes here
%% Parameter check
if
nargin
==
2
pAsStruct
=
false
;
end
%% Return as structure if requested
if
pAsStruct
extractedSoundsources
=
createStruct
();
return
;
end
%% Initialize return variable
extractedSoundsources
=
{};
...
...
@@ -13,5 +24,15 @@ for i = 1:length(pSourcesToExtract)
end
end
function
[
extractedSoundsources
]
=
createStruct
()
extractedSoundsources
=
struct
();
for
o
=
1
:
length
(
pSourcesToExtract
)
if
~
isfield
(
pSoundsources
,
pSourcesToExtract
{
o
})
continue
;
end
extractedSoundsources
.
(
pSourcesToExtract
{
o
})
=
pSoundsources
.
(
pSourcesToExtract
{
o
});
end
end
end
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