This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function [spikes, tv] = generatePoissonSig(fs, prbprc_per_s, dur, refPeriod, n_ev) | |
% e.g. [spikes, tv] = generatePoissonSig(100, 5, 210, 5.5, [1 Inf]) | |
tv = linspace(0, dur, dur*(fs)); | |
spikes = logical(tv*0); | |
k=0; | |
evProb = prbprc_per_s/fs; | |
% evProb | |
lastSpikeSec = 0; | |
while 1 |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Auto-generated by Data Acquisition Toolbox Analog Input Recorder on 2018/11/05 16:12:30 | |
close all | |
%% Create Data Acquisition Session | |
% Create a session for the specified vendor. | |
s = daq.createSession('ni'); | |
%% Set Session Properties | |
% Set properties that are not using default values. | |
s.Rate = 5000; | |
s.IsContinuous = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function [sh, lh, mp] = dotPlot(X, G, Wid, med, beas) | |
% [sh, lh, mp] = dotPlot(X, G, Wid, med, beas) | |
% | |
% load fisheriris.mat | |
% [sh, lh, mp] = dotPlot(meas(:,3), species, .25, false, true) | |
% | |
% input: | |
% X: data | |
% G: Group | |
% Wid: width of dot distribution (default: .35) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% functions | |
function myax2 | |
myax | |
p = findobj(gcf,'Type','Axes'); | |
set(p,'FontSize', 8, 'FontName', 'Arial', 'box', 'off', 'TickDir', 'out'); | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% 初期化 | |
clear variables | |
close all; | |
%% 定数,ディレクトリ | |
NPWIDTH = 10; | |
rootDir = 'C:\Users\rysk\Documents\MATLAB\oskd'; | |
roiRoot = [rootDir filesep 'RoiSet']; | |
meanImgName = [rootDir filesep 'averaged.tif']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
img = double(2^8-imread('eight.tif')); % ここは適宜 | |
figure; | |
subplot(1,2,1) | |
imagesc(img); axis image; | |
title('Image') | |
% 直径をマニュアルで決めるとき | |
% circROI = imellipse; | |
% circPos = getPosition(circROI); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function shuffled_idx = ratio_shuffle(len, ratio) | |
% hidx = 1:4:length(tune(:)); | |
% hidxs = hidx(randperm(length(hidx))); | |
% tune_h = tune; | |
% tune_h(hidx) = tune(hidxs); | |
shuffled_idx = 1:len; | |
soi = randperm(len); | |
soi_s = soi(1:floor(len*ratio)); | |
soi_s = soi_s(randperm(length(soi_s))); | |
shuffled_idx(soi(1:floor(len*ratio))) = soi_s; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Happy - Unhappy! | |
Happy_dir = 'E:\Drives\Google ドライブ\testData\selected_happy'; | |
Neutl_dir = 'E:\Drives\Google ドライブ\testData\selected_neutral'; | |
%% load Happy | |
hfiles = dir([Happy_dir filesep '*.png']); | |
nfiles = dir([Neutl_dir filesep '*.png']); | |
targSize = 64; | |
clear imgs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% 読み込みファイル (uigetfileを使うと良い) | |
clear all; | |
imname = 'Registered_03.tif'; | |
%% Tiff header情報の の読み取り | |
tObj = Tiff(imname, 'r'); | |
tags = tObj.getTagNames; | |
info = imfinfo(imname); | |
tic |
NewerOlder