Skip to content

Instantly share code, notes, and snippets.

@Choumingzhao
Choumingzhao / MATLAB_mul_compare.md
Last active September 4, 2017 12:31
MATLAB按元素相乘运算速度比较

众所周知,MATLAB长于矩阵运算,在使用矩阵进行运算时比普通的循环快得多,同时,不同的矩阵运算速度也会有不同。以下为实例:

>> clear all  
>> a = rand(100000000, 1);  
>> tic; a'*a; toc % 方法一,矩阵乘法  
时间已过 0.054834 秒。  
>> tic; a.*a; toc % 方法二,不包括求和  
时间已过 0.211555 秒。  
>> tic; sum(a.*a); toc % 方法二,包括求和  
时间已过 0.447394 秒。 
@Choumingzhao
Choumingzhao / Git_note.md
Last active August 17, 2021 02:49
Git learning note

Notes for Git novice

  1. how to recover a file in previous commit The answer
  2. When a push failed because the others edit your remote repo The answer