Sparse Matrix in Altair Compose

rodolfobibiano
rodolfobibiano New Altair Community Member
edited October 2020 in Community Q&A

I need to store a big amout of data in a matrix but can't find how to use sparse matrix in altair compose. Is there any specific funcion? In matlab I would use 'spalloc'

Tagged:

Welcome!

It looks like you're new here. Sign in or register to get started.

Answers

  • L Moretti
    L Moretti New Altair Community Member
    edited March 2020

    Hi Rodolfo,

     

    You can use the function sparse.

     

    For example if you have a full matrix you can convert it in this way:

     

    sparse(eye(6))

     

    Or you can create a sparse matrix specifying the row & col index and the related value. For example:

     

    m = [1 4 10];

    n = [ 2 6 8];

    val = [1 3 8];

    Matrix = sparse(m,n,val)

     

    Hope it helps,

     

    Lorenzo

  • rodolfobibiano
    rodolfobibiano New Altair Community Member
    edited March 2020

    Should I install some type of extension in altair compose to make it work?

    <?xml version="1.0" encoding="UTF-8"?>sparse.PNG

  • L Moretti
    L Moretti New Altair Community Member
    edited March 2020

    Hi Rodolfo,

     

    you should use Compose 2019.3!

     

     

    Lorenzo

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.