Rank: 2842 based on 40 downloads (last 30 days) and 1 file submitted
photo

Nicolas

E-mail

Personal Profile:

 

Watch this Author's files

 

Files Posted by Nicolas
Updated   File Tags Downloads
(last 30 days)
Comments Rating
16 Sep 2013 Snip.m Snip elements out of vectors/matrices Solves problems s.a. 'remove all nan' from a vector, 'get rid of 14th row of matrix' with low effort Author: Nicolas basic function, matrix manipulation, easy, vector manipulation, beginner, deletion 40 5
  • 5.0
5.0 | 2 ratings
Comments and Ratings by Nicolas View all
Updated File Comments Rating
26 Sep 2013 Snip.m Snip elements out of vectors/matrices Solves problems s.a. 'remove all nan' from a vector, 'get rid of 14th row of matrix' with low effort Author: Nicolas

Hi Val,
Thank you for that idea. I mused over it a bit and decided not to do that. First, because it would overburden the function with something not many people would use - I reckon. And second, because the way it is implemented your idea would require substantial rewriting for the necessary bookkeeping in snip.m.

For your application, I recommend to stack all your data like this:
A = [0 0 0; 1 2 3; 4 5 6];
B = [1 2 3; 4 5 6; 7 8 9];
C(:,:,1) = A; C(:,:,2) = B;
And now find the appropriate case in snip.m and implement that a 'slice' is cut out from your 'stack' by eliminating all those columns/rows under/above e.g. where A has the [0 0 0]. This should easily be possible in a similar way as in snip.m, when you use only the A 'sheet' in the 'stack' as the steering mechanism for the algorithm.

17 Sep 2013 Snip.m Snip elements out of vectors/matrices Solves problems s.a. 'remove all nan' from a vector, 'get rid of 14th row of matrix' with low effort Author: Nicolas

Hi William, thx for the feedback. I put in the option to give inf and i or j as arguments for removing infinity and complex items just like the others. Wish I could find how to answer your comment directly, though.

Comments and Ratings on Nicolas 's Files View all
Updated File Comment by Comments Rating
26 Aug 2014 Snip.m Snip elements out of vectors/matrices Solves problems s.a. 'remove all nan' from a vector, 'get rid of 14th row of matrix' with low effort Author: Nicolas Amir

It works fine on well explained example vectors but not on double vector type. Any comment on that?

26 Sep 2013 Snip.m Snip elements out of vectors/matrices Solves problems s.a. 'remove all nan' from a vector, 'get rid of 14th row of matrix' with low effort Author: Nicolas Nicolas

Hi Val,
Thank you for that idea. I mused over it a bit and decided not to do that. First, because it would overburden the function with something not many people would use - I reckon. And second, because the way it is implemented your idea would require substantial rewriting for the necessary bookkeeping in snip.m.

For your application, I recommend to stack all your data like this:
A = [0 0 0; 1 2 3; 4 5 6];
B = [1 2 3; 4 5 6; 7 8 9];
C(:,:,1) = A; C(:,:,2) = B;
And now find the appropriate case in snip.m and implement that a 'slice' is cut out from your 'stack' by eliminating all those columns/rows under/above e.g. where A has the [0 0 0]. This should easily be possible in a similar way as in snip.m, when you use only the A 'sheet' in the 'stack' as the steering mechanism for the algorithm.

21 Sep 2013 Snip.m Snip elements out of vectors/matrices Solves problems s.a. 'remove all nan' from a vector, 'get rid of 14th row of matrix' with low effort Author: Nicolas Val

This is great! I have had similar problems, so this is a great solution.

One additional functionality would be appreciated, which is that the function can optionally output the indices of the old matrix that are kept after snipping. This way, any other matrices that are the same size as the old matrix can be pared down in the appropriately matched rows and columns.

17 Sep 2013 Snip.m Snip elements out of vectors/matrices Solves problems s.a. 'remove all nan' from a vector, 'get rid of 14th row of matrix' with low effort Author: Nicolas Nicolas

Hi William, thx for the feedback. I put in the option to give inf and i or j as arguments for removing infinity and complex items just like the others. Wish I could find how to answer your comment directly, though.

04 Sep 2013 Snip.m Snip elements out of vectors/matrices Solves problems s.a. 'remove all nan' from a vector, 'get rid of 14th row of matrix' with low effort Author: Nicolas William Sutton

Seems to work quite well. Any advice on getting it to remove Inf?

Contact us