Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
faust
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
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
faust group
faust
Commits
9aec580c
Commit
9aec580c
authored
2 years ago
by
hhakim
Browse files
Options
Downloads
Patches
Plain Diff
Add an example in matfaust.lazylinop.diag doc.
parent
c4095427
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
wrapper/matlab/+matfaust/+lazylinop/diag.m
+58
-1
58 additions, 1 deletion
wrapper/matlab/+matfaust/+lazylinop/diag.m
with
58 additions
and
1 deletion
wrapper/matlab/+matfaust/+lazylinop/diag.m
+
58
−
1
View file @
9aec580c
...
...
@@ -4,7 +4,64 @@
%> @param v a vector for the diagonal.
%> @param k (int, optional) diagonal to place the vector on. Default is 0 (main diagonal). Negative integer for a diagonal below the main diagonal, strictly positive integer for a diagonal above.
%>
%> @retval the diagonal LazyLinearOp.
%> @retval DL the diagonal LazyLinearOp.
%>
%> @b Example
%> @code
%> >> import matfaust.lazylinop.diag
%> >> v = rand(1, 5)
%> >> ld1 = diag(v)
%>
%> ld1 =
%>
%> 5x5 LazyLinearOp array with no properties.
%>
%> >> full(ld1)
%> ans =
%>
%> 0.6678 0 0 0 0
%> 0 0.8444 0 0 0
%> 0 0 0.3445 0 0
%> 0 0 0 0.7805 0
%> 0 0 0 0 0.6753
%>
%> >> ld2 = diag(v, -2)
%>
%> ld2 =
%>
%> 7x7 LazyLinearOp array with no properties.
%>
%> >> full(ld2)
%>
%> ans =
%>
%> 0 0 0 0 0 0 0
%> 0 0 0 0 0 0 0
%> 0.6678 0 0 0 0 0 0
%> 0 0.8444 0 0 0 0 0
%> 0 0 0.3445 0 0 0 0
%> 0 0 0 0.7805 0 0 0
%> 0 0 0 0 0.6753 0 0
%>
%> >> ld3 = diag(v, 2)
%>
%> ld3 =
%>
%> 7x7 LazyLinearOp array with no properties.
%>
%> >> full(ld3)
%>
%> ans =
%>
%> 0 0 0.6678 0 0 0 0
%> 0 0 0 0.8444 0 0 0
%> 0 0 0 0 0.3445 0 0
%> 0 0 0 0 0 0.7805 0
%> 0 0 0 0 0 0 0.6753
%> 0 0 0 0 0 0 0
%> 0 0 0 0 0 0 0
%>
%> @endcode
%>
%=============================================================
function
DL
=
diag
(
v
,
varargin
)
...
...
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