Course Solutions Uncategorized (Solved) : Matlab Function Datamat Genfakedata Nrep Rng Shuffle Nrep Q29224023 . . . .

(Solved) : Matlab Function Datamat Genfakedata Nrep Rng Shuffle Nrep Q29224023 . . . .

 

(MATLAB)

function dataMat = genFakeData(nRep)

rng(‘shuffle’);

if nRep<1

error(‘nRep must be 1 or greater’);

end

if nRep ~= round(nRep)

error(‘nRep must be a whole number’);

end

var1 = [1 1 2 2]; % IV1: first two at level 1, second two atlevel 2 v

ar2 = [1 2 1 2]; % IV2: first & third at level 1, second& fourth at lvl 2

dataMat = [var1′ var2′];

dataMat = repmat(dataMat,nRep,1); % THINK: what do nRep and 1represent?

nTrials = size(dataMat,1);

trialNums = (1:nTrials)’;

correct = round(rand(nTrials,1));

dataMat = [trialNums dataMat correct];

QUESTION: Modify genFakedata Add a new input argument togenFakeData2 called nLevels. This will change the number of levelsof each variable (as opposed to

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

(Solved) : D Question 11 Match Usage Different Areas Memory Layout Assumed Software Programs Os Stack Q35399151 . . . .(Solved) : D Question 11 Match Usage Different Areas Memory Layout Assumed Software Programs Os Stack Q35399151 . . . .

<br/><img src="https://media.cheggcdn.com/media%2F1ff%2F1ffa1c9f-a1e4-493a-984e-b977d1a68629%2Fimage.png" alt="D | Question 11 Match usage of different areas in the memory layout as assumed by software programs /OS. Stack ic Data Static" aria-describedby="d3f"/><img src="https://media.cheggcdn.com/media%2F8c6%2F8c6c81ed-3433-4fbf-a256-524938f1f448%2Fimage.png" alt="Reserved I Choose