Basically i am just trying to figure out how much of an issue this is, speed increase-wise. But i havent been able to make an example showing why one should bother at all.
My example shows about even performance:
clear all;clc;%Number of random numbers generated
T = 5000000;%Number of times experiment is repeated
N = 20;%Timer variables for tic/toc
timer1 = zeros(N,1);timer2 = zeros(N,1);for j=1:Ny1 = zeros(T,1);y2 = zeros(T,1);x1 = normrnd(0,1,T,1);x2 = normrnd(0,1,T,1);x3 = normrnd(0,1,T,1);x4 = normrnd(0,1,T,1);%Short cirkuited loop
ticfor i = 1:T if (x1(i)>0 && x2(i)>0 && x3(i)>0 && x4(i)>0) y1(i) = 1; endendtimer1(j) = toc;%standard loop
ticfor i = 1:T if (x1(i)>0 & x2(i)>0 & x3(i)>0 & x4(i)>0) y2(i) = 1; endendtimer2(j) = toc;endmean(timer1)mean(timer2)
Best Answer