I am trying to find a way in Matlab to truncate values of a vector, keeping only the first N digits (I don't want to round it, just to cut it.) of them. I wrote something which converts the values in strings, cut those and returns the number truncated, but it is too slow.
Any more clever solution?
Thanks a lot in advance!
You could use the same logic than in this example:
And apply it to vectors/matrices.