Sparse Support for MATLAB Coder

Does the MATLAB Coder support sparse Matrices created for example with the sparse() function? Something like
A = sparse(zeros(4,4));
A(3,3) = 1.0;
Thanks in advance

답변 (3개)

wma
wma 2011년 7월 12일

0 개 추천

Where do i have to set this "sparse=true"?? Icannot find a setting.
Walter Roberson
Walter Roberson 2011년 7월 12일

0 개 추천

Use the syntax
t=coder.newtype(numeric_class, sz, variable_dims, Name, Value)
with Name being 'sparse' and Value being true:
t=coder.newtype(numeric_class, sz, variable_dims, 'sparse', true)

댓글 수: 1

wma
wma 2011년 7월 13일
Hello and thank you for your answer.
Unfortunately it does not work. "coder.newtype" is not a recognized keyword.
I am trying to translate this:
A = sparse(zeros(p,2*p));
B = sparse(zeros(k+p,2*(k+p)));

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Sparse Matrices에 대해 자세히 알아보기

질문:

wma
2011년 7월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by