subdict
Extract submatrix from a sensing dictionary
Description
returns the submatrix Ar
= subdict(A
,rowIndices
,colIndices
)Ar
that corresponds to the rows and columns
specified by rowIndices
and colIndices
,
respectively.
Examples
Extract and Visualize Submatrix
Create a sensing dictionary. Set the type of the sensing dictionary to 'fourier'
and 'eye'
. The size of each basis type is 100-by-100.
A = sensingDictionary(Size=100,Type={'fourier','eye'})
A = sensingDictionary with properties: Type: {'fourier' 'eye'} Name: {'' ''} Level: [0 0] CustomDictionary: [] Size: [100 200]
Extract the entire submatrix that is associated with the 'eye'
basis type. Visualize the submatrix.
Bmat = subdict(A,1:100,101:200); imagesc(Bmat)
Extract a 25-by-50 submatrix associated with the 'fourier'
basis type. Visualize the real and imaginary parts of the submatrix.
Cmat = subdict(A,1:25,1:50); subplot(1,2,1) imagesc(real(Cmat)) title("Real Part") subplot(1,2,2) imagesc(imag(Cmat)) title("Imaginary Part")
Input Arguments
A
— Sensing dictionary
sensingDictionary
object
Sensing dictionary, specified as a sensingDictionary
object.
rowIndices
— Row indices
vector
Row indices to extract, specified as a vector.
Example: Ar = subdict(A,1:256,1:100)
returns the 256-by-100
submatrix that corresponds to the rows indexed by 1:256
and columns
indexed by [1:100]
.
Data Types: double
colIndices
— Column indices
vector
Column indices to extract, specified as a vector.
Example: Ar = subdict(A,1:128,[2 3 5 8 13])
returns the 128-by-5
submatrix that corresponds to the rows indexed by 1:128
and columns
indexed by [2 3 5 8 13]
.
Data Types: double
Output Arguments
Ar
— Submatrix
matrix
Submatrix extracted from the sensingDictionary
A
, returned as a matrix. The matrix Ar
is
M-by-N, where M equals the
length of rowIndices
, and N equals the length of
colIndices
.
Data Types: double
Version History
Introduced in R2022a
See Also
Abrir ejemplo
Tiene una versión modificada de este ejemplo. ¿Desea abrir este ejemplo con sus modificaciones?
Comando de MATLAB
Ha hecho clic en un enlace que corresponde a este comando de MATLAB:
Ejecute el comando introduciéndolo en la ventana de comandos de MATLAB. Los navegadores web no admiten comandos de MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)