how to write this data into a sparse matrix
Mostra commenti meno recenti
Dear All,
I have this data which is represent 0,1 matrix. it is given in this way. the first element 12,4,3,18,19,10 means the number of position of the ones in this row. I want to create a sparse matrix for it. can anyone help me with it?
12 1 2 3 4 60 61 62 63 89 90 91 95
4 32 33 34 35
3 83 84 91
18 39 40 41 42 43 71 72 73 74 75 76 77 88 90 92 93 94 95
19 29 30 31 32 33 34 35 36 37 79 80 81 83 84 85 86 87 88 89
10 73 86 87 88 89 90 91 92 93 94
the final matrix should have size 6x95. I appreciate any help.
regards,
Nadia
4 Commenti
the cyclist
il 29 Feb 2016
How are these input data stored now? For example, do you have six different vectors with these values? How are they named?
nadia nadi
il 29 Feb 2016
Stephen23
il 29 Feb 2016
Please edit your question and upload your exact data: click the paperclip button, then both Choose file and Attach file buttons.
How did you get all of these lines of numbers into this text file? Did you copy-and-paste them from some source? If so, what source? It may be easier to simply get MATLAB to read the data directly from that source.
The answer really depends on you: do you want a general solution that will also work for other data, or are you wanting to process only this data?
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Text Data Preparation in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!