arraySize = 24;
tArray = [1:arraySize];
startIdx = (labindex-1)*(arraySize/numlabs) + 1;
endIdx = startIdx + (arraySize/numlabs) - 1;
for index = startIdx:endIdx
for throw_1 = 1:1:6
for throw_2 = 1:1:6
RollTotal = throw_1 + throw_2;
NumbersThrownCount(RollTotal) = NumbersThrownCount(RollTotal) + 1;
Probability = NumbersThrownCount(Throw) / sum(NumbersThrownCount) * 100;
Throw = input('For which throw would you like the probability?');
if Throw > 24 fprintf("Sorry but the throw you want the probability for is invalid please try again\n"); Throw = input('For which throw would you like the probability?'); end
fprintf("The probability of throwing a %d is %f %%\n", Throw, Probability);
Error using SPMD (line 6) Error detected on workers 2 3.
Caused by: Error using SPMD (line 6) An UndefinedFunction error was thrown on the workers for 'NumbersThrownCount'. This may be because the file containing 'NumbersThrownCount' is not accessible on the workers. Specify the required files for this parallel pool using the command: addAttachedFiles(pool, ...). See the documentation for parpool for more details. Unrecognized function or variable 'NumbersThrownCount'.
What I am trying to do is get the data from the SPMD loop so that I can then ask the user what the probability is rolling 'x' value on the dice. The error I get is shown below any help with this would be great as I am really stuck with this. Thanks in advance