Let's first see what you have in those mat files:
s1=load('prediction.mat')
s1 =
allBW: [130×130×90 logical]
s2=load('groundtruth.mat')
s2 =
allBW: [130×130×90 logical]
So you have two equal-sized binary arrays.
Ten seconds of Googling ('wiki dice coefficient') can give you this formula:
Now you only have to implement this in Matlab.
DSC = (2*sum(X&Y))/(sum(X)+sum(Y))
We can check this implementation by using the other notation: