This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
analysis:nsb2015:week3short [2015/07/16 19:05] mvdm |
analysis:nsb2015:week3short [2018/07/07 10:19] (current) |
||
---|---|---|---|
Line 46: | Line 46: | ||
<code matlab> | <code matlab> | ||
%% cd to data folder -- replace this with yours | %% cd to data folder -- replace this with yours | ||
- | fd = 'D:\data\DataAnalysisTutorial\R042-2013-08-18'; | + | fc = 'D:\data\DataAnalysisTutorial\R042-2013-08-18'; |
cd(fc); | cd(fc); | ||
Line 148: | Line 148: | ||
==== A fully featured plotting function ==== | ==== A fully featured plotting function ==== | ||
+ | ''MultiRaster()'' is a versatile and fast plotting function, with many different options and features. | ||
+ | The most basic usage is simply: | ||
+ | |||
+ | <code matlab> | ||
+ | MultiRaster([],S) | ||
+ | </code> | ||
+ | |||
+ | Note that the first argument in this case is the empty matrix ''[]''. For more features, this argument is used as a ''cfg'' variable with several options, for instance: | ||
+ | |||
+ | <code matlab> | ||
+ | plot_cfg = []; | ||
+ | plot_cfg.lfp = csc; | ||
+ | plot_cfg.spkColor = 'hsv'; | ||
+ | MultiRaster(plot_cfg,S) | ||
+ | </code> | ||
+ | |||
+ | This particular data set also has some experimenter annotations associated with it, for example in the %%ExpKeys%% file: | ||
+ | |||
+ | <code matlab> | ||
+ | >> LoadExpKeys | ||
+ | >> ExpKeys | ||
+ | |||
+ | ExpKeys = | ||
+ | |||
+ | Behavior: 'MotivationalT' | ||
+ | RestrictionType: 'water' | ||
+ | Session: 'standard' | ||
+ | Layout: 'foodLeft' | ||
+ | Pedestal: 'R' | ||
+ | nPellets: 5 | ||
+ | waterVolume: [] | ||
+ | nTrials: 18 | ||
+ | forcedTrials: [] | ||
+ | nonConsumptionTrials: [] | ||
+ | badTrials: [] | ||
+ | pathlength: 318 | ||
+ | patharms: 369 | ||
+ | realTrackDims: [139 185] | ||
+ | convFact: [2.9176 2.3794] | ||
+ | TimeOnTrack: 3240 | ||
+ | TimeOffTrack: 5645 | ||
+ | prerecord: [2.1266e+03 3.2141e+03] | ||
+ | task: [3.2387e+03 5.6452e+03] | ||
+ | postrecord: [5.6564e+03 6.5635e+03] | ||
+ | goodSWR: {1x2 cell} | ||
+ | goodTheta: {'R042-2013-08-18-CSC07a.ncs'} | ||
+ | |||
+ | </code> | ||
+ | |||
+ | The meaning of these fields is explained in more detail in the full [[task description]], but for now we will just use the start and end times for the 'prerecord' segment of the data to highlight it visually: | ||
+ | |||
+ | <code matlab> | ||
+ | plot_cfg = []; | ||
+ | plot_cfg.evt = iv(ExpKeys.prerecord); | ||
+ | plot_cfg.evtColor = [0 0 0.5]; | ||
+ | MultiRaster(plot_cfg,S) | ||
+ | </code> | ||
+ | |||
+ | ''MultiRaster()'' is interactive, allowing the user to scroll, zoom, move from one event to another, et cetera. To see the full list of keybindings, type ''help navigate''. | ||
+ | |||
+ | The [[analysis:nsb2015:week3long|long version]] of this module challenges you to write a version of this visualization function yourself, so you can understand how it is done, and customize it for your application. |