%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% clear all;clc; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % haemodynamic response function: BOLD signal has stereotyped shape every % time a stimulus hits it. We usually use the spm_hrf.m in S…
本程序意在解释这样几个问题:完整版代码在本文的最后. 1.实验的设计如何转换成设计矩阵? 2.设计矩阵的每列表示一个刺激条件,如何确定它们? 3.如何根据设计矩阵和每个体素的信号求得该体素对刺激的敏感性? 程序详解: 1.构造hrf hrf_small = [ 0 4 2 -1 0 ]; figure(1); clf; plot(0:4,hrf_small,'o-'); grid on; xlabel('Time (in units of TRs, 4s long each)'); ylabel…
这里包含了这样一个数据集:slice_data.mat. 这个数据集中包含的mri数据是:64*64*25.共有25个slice.每个slice的分辨率是64*64. 程序非常简短: load slice_data.mat %转载数据 for i=1:25 %总共有25个切片 subplot(5,5,i) slice=scan1(:,:,i); imagesc(slice'); %这里对图像矩阵过了转置.不然头是歪的. end 本程序讲解了:fMRI每1秒钟对大脑进行25层全脑扫描究竟发生了什么…
打造一个很简单的文档转换器 - 使用组件 Spire.Office [博主]反骨仔 [原文]http://www.cnblogs.com/liqingwen/p/6024827.html 序 之前,<开头不讲"Hello Word",读尽诗书也枉然 : Word 操作组件介绍 - Spire.Doc>一文简单介绍了 Spire.Doc 如何使用.这次我们来介绍如何打造一个简单的文档转换器. 目录 Spire.Office 介绍 库引用 界面预览 代码片段 Spire.Off…
以下是转载于网上的一个很好的config文件的实现,留存以备案 //Config.h #pragma once #include <string> #include <map> #include <iostream> #include <fstream> #include <sstream> /* * \brief Generic configuration Class * */ class Config { // Data protected:…
一个很奇怪的现象:我的主机能ping通同一网段的其它主机,并也能xshell 远程其它的主机,而其它的主机不能ping通我的ip,也不能远程我和主机. [root@NB Desktop]# route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface virbr0 link-local * br0 br0 我的内网网段是10.100.2.0/24 解决这种问题的方式是: [root@NB…
今天做一个很简单的oj来温习下c 语言 题目如下 输入 3位正整数 输出 逆置后的正整数 代码如下: #include"stdio.h"int main(){ float h,sum;int inputCount;int n; char input[3]; scanf("%s",&input);n=2; while(n>=0) {  if(n==2&&input[n]=='0')  {   n--;   continue;  }  if…
本文给出一个很实用的服务端和客户端进行TCP通信的小例子.具体实现上非常简单,只是平时编写类似程序,具体步骤经常忘记,还要总是查,暂且将其记下来,方便以后参考. (1)客户端程序,编写一个文件client.c,内容如下: #include <stdlib.h> #include <stdio.h> #include <unistd.h> #include <string.h> #include <sys/types.h> #include <…
一个很好的Delphi博客,主人叫万一 http://www.cnblogs.com/del/archive/2011/09/21/2183007.html…
转自 http://blog.chinaunix.net/uid-20328094-id-95121.html 一个很不错的bash脚本编写教程,至少没接触过BASH的也能看懂! 建立一个脚本 Linux中有好多中不同的shell,但是通常我们使用bash (bourne again shell) 进行shell编程,因为bash是免费的并且很容易使用.所以在本文中笔者所提供的脚本都是使用bash(但是在大多数情况下,这些脚本同样可以在 bash的大姐,bourne shell中运行). 如同其…