# How to use CompressedSensing package by using function instead of measurement matrix?

**URL:** <https://discourse.julialang.org/t/how-to-use-compressedsensing-package-by-using-function-instead-of-measurement-matrix/34787>\
**Category:** General Usage\
**Tags:** package\
**Created:** [February 18, 2020, 4:59am UTC](https://discourse.julialang.org/t/how-to-use-compressedsensing-package-by-using-function-instead-of-measurement-matrix/34787 "2020-02-18T04:59:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Manu\_Francis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/manu_francis/32/10010_2.png) [@Manu\_Francis](https://discourse.julialang.org/u/Manu_Francis)\
**Post date:** [February 18, 2020, 4:59am UTC](https://discourse.julialang.org/t/how-to-use-compressedsensing-package-by-using-function-instead-of-measurement-matrix/34787/1 "2020-02-18T04:59:32Z")

</div>

Hi,

I am trying to use CompressedSensing package. I went through the examples in the [documentation](https://compressedsensing.readthedocs.io/en/latest/Examples/) is as follows:

```julia
n=1000 #Signal Dimensions
m=400 #Measurement Dimension
k=100 #Approximate Sparsity

Signal = zeros(n) #Create a random sparse signal
Signal[int(rand(k)*(n-1)+1)] = randn(k)

MM = randn(m,n) #Create a random measurement matrix
Measurement = MM*Signal #Measure the signal using the measurement matrix

#Reconstruct using IRLS
Reconstruction = IRLS(MM,Measurement,verbose=true)

```

I want to use a function instead of MM, because the size of MM will be very large in my case. Then my code will be modified as

```julia
Measurement = measurement_function(Signal) #Measure the signal using the measurement function

```

Then I want to use that function for reconstruction of signal, something look like below:

```julia
Reconstruction = IRLS(measurement_function(),Measurement)

```

Will it be possible with CompressedSensing package?

Thanks in Advance!  
Manu

---

<div class="post-metadata">

**Author:** ![baggepinnen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/baggepinnen/32/693_2.png) [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Post date:** [February 18, 2020, 5:31am UTC](https://discourse.julialang.org/t/how-to-use-compressedsensing-package-by-using-function-instead-of-measurement-matrix/34787/2 "2020-02-18T05:31:52Z")

</div>

Are you talking about this package?

> **[GitHub - dahlend/CompressedSensing.jl: Several Compressed Sensing functions...](https://github.com/dahlend/CompressedSensing.jl)**
>
> Several Compressed Sensing functions for Julia. Contribute to dahlend/CompressedSensing.jl development by creating an account on GitHub.

It appears to have been archived and not updated for 5 years.

---

<div class="post-metadata">

**Author:** ![Manu\_Francis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/manu_francis/32/10010_2.png) [@Manu\_Francis](https://discourse.julialang.org/u/Manu_Francis)\
**Post date:** [February 18, 2020, 5:48am UTC](https://discourse.julialang.org/t/how-to-use-compressedsensing-package-by-using-function-instead-of-measurement-matrix/34787/3 "2020-02-18T05:48:26Z")

</div>

@baggepinnen : yes …I tried to use this… ohh it’s archived … 😔 Sorry to disturb you
