Precision may vary! But a raster is inherently limited in it’s temporal resolution (either you look at precise ticks over a shorter time span or imprecise ticks over a longer time span). The way to do it is to add half of your binning size to the xlabel vector (in my experience, this will align your ticks optimally with spike times). The trick is aligning the x labels of the imagesc() output appropriately. Regular data grids require a referencing object, vector, or matrix that describes the sampling and location of the data points. (NaN-padded is best, but this is a different discussion). Raster data, also known as data grids, stores map data as matrices. SpikeHist=histc(spikeTimes,histEdges), where histEdges is the binning vector used to create the histogram, for example, something like the vector: -1000:binSize:1000 (binSize=1 or 2 ms), and spikeTimes is a (trial rows x n columns) array of spike times. Imagesc(histEdges+(0.5*binSize),spikeHist*-1) %This is the whole she-bangĬolormap(gray) %This makes your -1 spikeHist tick marks black and your 0 values white/ First, a MATLAB code is used to compute the. There is a relatively simple way to create a multi-line raster as well: essentially, put your spikes into a fine-grain histogram (1-2ms bins) and put that array into imagesc().Ĭode (style adjustments as described above are still needed): raster scan and two dimensional discrete wavelet transform (2-D DWT). The Mathworks don’t even know how to look up functions in their own global namespace Matlab doesn’t know how to draw one ball out of an urn containing one ball Looking for a wry take on MATLAB’s shortcomings from an anonymous neuroscientist? Try Abandon MATLAB. Set(gca,'YColor',get(gcf,'Color')) % hide the y axis Set(gca,'Color',get(gcf,'Color')) % match figure background Set(gca,'PlotBoxAspectRatio',) % short and wide Set(gca,'YTick', ) % don't draw y-axis ticks Set(gca,'TickDir','out') % draw the tick marks on the outside Here’s some code to draw simple, one line raster plots: But it does all start with one line of code. In the end, you know you’re going to be spending half a day with Adobe Illustrator to fix it. True, but then you spend another 10 lines of code trying to make it not look like complete crap. Can you help to write a code for ROI extraction block for creating a simulinks for the project human recognition using combined features of finger texture and vein. Sign In to Your MathWorks Account My Account. A colleague once told me: “in MATLAB, drawing a raster plot is a trivial, one line command”. How to scan an image as a whole and separate the area of interest using matlab.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |