Borrar filtros
Borrar filtros

density meaning and when we should use it

7 visualizaciones (últimos 30 días)
Hajar Alshaikh
Hajar Alshaikh el 2 de Mzo. de 2023
Comentada: Rik el 2 de Mzo. de 2023
what do you mean by :
for density=.2:.01:.2
and what is the benifit of using the desity in matlab code (when we should use it)?
if you can give me a simple example, i will be appreciate it
Also, what is A(1:n+1:end) means?
  1 comentario
Rik
Rik el 2 de Mzo. de 2023
If you have trouble with Matlab basics you may consider doing the Onramp tutorial (which is provided for free by Mathworks).

Iniciar sesión para comentar.

Respuesta aceptada

Sivapriya Srinivasan
Sivapriya Srinivasan el 2 de Mzo. de 2023
Hey Hajar,
  1. For density=.2:0.01:.2 means it creates a vector of numbers ranging from 0.2 to 0.2 with an increment of 0.01. However, since the start and end are the same it represents a scalar value 0.2 .
  2. Density is not any particular command in MATLAB it is just a variable which we have used, it can be replaced with any other variable name
  3. The expression A(1: n+1: end) is used to extract elements from a matrix A’. This results in a sequence of indices that start at the first element of the first row and then skips n+1 elements to select the next element along the diagonal of the matrix, this continues until the last element of the last row is reached.
You can also refer this documentation for further understanding : MathWorks Documentation
Hope this helps!

Más respuestas (0)

Categorías

Más información sobre Geometric Transformation and Image Registration en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by