MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi
Learn moreOpportunities for recent engineering grads.
Apply TodayNew to MATLAB?
MATLAB Central > MATLAB Newsreader > Index matrix to sparse matrix... saving memory 

Subject: Index matrix to sparse matrix... saving memory From: Anthony Hopf Date: 29 May, 2010 16:30:23 Message: 1 of 29 
Latest problem.... 
Subject: Index matrix to sparse matrix... saving memory From: Bruno Luong Date: 29 May, 2010 16:43:05 Message: 2 of 29 
"Anthony Hopf" <anthony.hopf@gmail.com> wrote in message <htrfev$fo7$1@fred.mathworks.com>... 
Subject: Index matrix to sparse matrix... saving memory From: Anthony Hopf Date: 29 May, 2010 16:58:05 Message: 3 of 29 
"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <htrg6p$2h3$1@fred.mathworks.com>... 
Subject: Index matrix to sparse matrix... saving memory From: Matt J Date: 29 May, 2010 17:49:22 Message: 4 of 29 
"Anthony Hopf" <anthony.hopf@gmail.com> wrote in message <htrfev$fo7$1@fred.mathworks.com>... 
Subject: Index matrix to sparse matrix... saving memory From: Anthony Hopf Date: 29 May, 2010 18:10:21 Message: 5 of 29 
"Matt J " <mattjacREMOVE@THISieee.spam> wrote in message <htrk32$2vm$1@fred.mathworks.com>... 
Subject: Index matrix to sparse matrix... saving memory From: Matt J Date: 29 May, 2010 18:28:05 Message: 6 of 29 
"Anthony Hopf" <anthony.hopf@gmail.com> wrote in message <htrlad$in3$1@fred.mathworks.com>... 
Subject: Index matrix to sparse matrix... saving memory From: Anthony Hopf Date: 29 May, 2010 21:56:05 Message: 7 of 29 
"Matt J " <mattjacREMOVE@THISieee.spam> wrote in message <htrmbl$nn6$1@fred.mathworks.com>... 
Subject: Index matrix to sparse matrix... saving memory From: Matt J Date: 29 May, 2010 23:48:08 Message: 8 of 29 
"Anthony Hopf" <anthony.hopf@gmail.com> wrote in message <hts2hl$3tk$1@fred.mathworks.com>... 
Subject: Index matrix to sparse matrix... saving memory From: Bruno Luong Date: 30 May, 2010 09:07:06 Message: 9 of 29 
"Anthony Hopf" <anthony.hopf@gmail.com> wrote in message <hts2hl$3tk$1@fred.mathworks.com>... 
Subject: Index matrix to sparse matrix... saving memory From: Anthony Hopf Date: 30 May, 2010 11:25:10 Message: 10 of 29 
"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <htt9rq$1s8$1@fred.mathworks.com>... 
Subject: Index matrix to sparse matrix... saving memory From: Bruno Luong Date: 30 May, 2010 12:02:04 Message: 11 of 29 
"Anthony Hopf" <anthony.hopf@gmail.com> wrote in message <htthum$sg$1@fred.mathworks.com>... 
Subject: Index matrix to sparse matrix... saving memory From: Anthony Hopf Date: 30 May, 2010 12:20:05 Message: 12 of 29 
"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <httk3s$hb0$1@fred.mathworks.com>... 
Subject: Index matrix to sparse matrix... saving memory From: Anthony Hopf Date: 8 Jun, 2010 19:47:04 Message: 13 of 29 
Sorry to "double" post this (seems to fit here much better than the other thread)... but I think I am starting to see the light on this today... I haven't looked at it in awhile. for the case of binning in range, code shown above, I am using this: 
Subject: Index matrix to sparse matrix... saving memory From: Bruno Luong Date: 8 Jun, 2010 20:25:20 Message: 14 of 29 
First, this a an monthold thread. I'm sorry but if you haven't not pay enough attention to what has been suggested for month (including Matt's remark about the missuse of sparse), the a lot time is waste. 
Subject: Index matrix to sparse matrix... saving memory From: Anthony Hopf Date: 8 Jun, 2010 20:40:05 Message: 15 of 29 
Thank you for your help, I apologize for my slow learning... you guys really are very good! 
Subject: Index matrix to sparse matrix... saving memory From: Anthony Hopf Date: 9 Jun, 2010 14:21:07 Message: 16 of 29 
Thank you Matt and Bruno!! I apologize for not staying with this topic, but I have quite a bit on my plate... and I am taking your advice, and TRYING to learn. You have both been very helpful and I hope you won't give up on me yet!! 
Subject: Index matrix to sparse matrix... saving memory From: Anthony Hopf Date: 9 Jun, 2010 14:59:08 Message: 17 of 29 
So I think a couple lines fixed the problem: 
Subject: Index matrix to sparse matrix... saving memory From: Anthony Hopf Date: 9 Jun, 2010 21:58:20 Message: 18 of 29 
I feel like I am sooo close.... 
Subject: Index matrix to sparse matrix... saving memory From: Bruno Luong Date: 10 Jun, 2010 09:28:03 Message: 19 of 29 
"Anthony Hopf" <anthony.hopf@gmail.com> wrote in message <hup2ps$rmb$1@fred.mathworks.com>... 
Subject: Index matrix to sparse matrix... saving memory From: Anthony Hopf Date: 10 Jun, 2010 18:58:04 Message: 20 of 29 
Bruno or anyone that has looked through the thread, 
Subject: Index matrix to sparse matrix... saving memory From: Bruno Luong Date: 10 Jun, 2010 19:18:04 Message: 21 of 29 
"Anthony Hopf" <anthony.hopf@gmail.com> wrote in message <hurcjs$h31$1@fred.mathworks.com>... 
Subject: Index matrix to sparse matrix... saving memory From: Bruno Luong Date: 10 Jun, 2010 19:38:05 Message: 22 of 29 
I wrote: 
Subject: Index matrix to sparse matrix... saving memory From: Anthony Hopf Date: 10 Jun, 2010 19:57:04 Message: 23 of 29 
I understood, and appreciate your help. accumarray it is!! 
Subject: Index matrix to sparse matrix... saving memory From: Anthony Hopf Date: 13 Jun, 2010 14:45:06 Message: 24 of 29 
Bruno... I can't believe I missed the funcitonality of histcn and accumarray!! This definitely gets me closer to my ultimate result. 
Subject: Index matrix to sparse matrix... saving memory From: Anthony Hopf Date: 14 Jun, 2010 01:17:04 Message: 25 of 29 
Thank you very much Bruno, and others, for giving your advise... 
Subject: Index matrix to sparse matrix... saving memory From: Bruno Luong Date: 14 Jun, 2010 06:07:03 Message: 26 of 29 
Take a look at example 10 of the doc of accumarray: 
Subject: Index matrix to sparse matrix... saving memory From: Anthony Hopf Date: 14 Jun, 2010 10:20:04 Message: 27 of 29 
Thank you Bruno... The extreme speed up I see using accumarray may negate the need to bin all of the index values for storage. But I will play with this more. 
Subject: Index matrix to sparse matrix... saving memory From: Anthony Hopf Date: 15 Jul, 2010 13:20:21 Message: 28 of 29 
Bruno, 
Subject: Index matrix to sparse matrix... saving memory From: Bruno Luong Date: 16 Jul, 2010 06:54:05 Message: 29 of 29 
"Anthony Hopf" <anthony.hopf@gmail.com> wrote in message <i1n1ul$mf0$1@fred.mathworks.com>... 
A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.
Anyone can tag a thread. Tags are public and visible to everyone.