How to convert numeric matrix into sparse matrix

I have a numeric matrix which the charcter
str =
Hello
a =
72 101 108 108 111 32
a = double(str)
Now i want to convert this numeric matrix into sparse matrix. Kindly help

1 Kommentar

Adam
Adam am 19 Dez. 2017
There isn't any value, as such, in creating a sparse matrix from a matrix containing no, or very few, zeros.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Birdman
Birdman am 19 Dez. 2017
Have you checked the function sparse?
sparse(a)

1 Kommentar

+1. :-)
@bavani: If you have a question about a certain feature, start with searching for it:
docsearch sparse
If this does not help, search in the internet. If there are still open questions, the forum is a good idea.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Sparse Matrices finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 19 Dez. 2017

Kommentiert:

Jan
am 19 Dez. 2017

Community Treasure Hunt

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

Start Hunting!

Translated by