Sparse Support for MATLAB Coder

11 次查看(过去 30 天)
wma
wma 2011-7-12
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 个)

Friedrich
Friedrich 2011-7-12

wma
wma 2011-7-12
Where do i have to set this "sparse=true"?? Icannot find a setting.

Walter Roberson
Walter Roberson 2011-7-12
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)));

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Sparse Matrices 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by