Multiplication of sparse matrix and a normal matrix
Show older comments
I have a Sparse Matrix : S
The size of S is : 196608x4096 sparse double
and the normal (Non Sparse) matrix : D
The size of D is : 196608x1 single
Matrix D is full of one . [ means : D= ones(196608,1 )]
I want to multiply them both >> transpose(S)* D;
But showing me some error :
- " Error using .* Sparse single array arithmetic operations are not supported."
- " Error using * MTIMES (*) is not supported for one sparse argument and one single argument "
Even I tried to convert the matrix D into sparse but showing me following error :
" Error using sparse Input matrix must be double or logical".
Any kind of suggestions to solve this problem will be appreciated.
Thank You !!!
Happy Weekend !!!
Accepted Answer
More Answers (2)
David Goodmanson
on 25 Sep 2021
Hi Amit,
sum(S)'
where the result is still sparse, or
full(sum(S)')
if you want a regular vector at that point.
1 Comment
Amit Chakraborty
on 25 Sep 2021
Amit Chakraborty
on 25 Sep 2021
0 votes
Categories
Find more on Sparse Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!