Example usage
% create an ME model
model = maxent.createModel(10,'ising');
% train it on a set of samples
model = maxent.trainModel(model,samples);
% create a set of samples corresponding to all possible states of the system
npatterns = 2^model.ncells;
unique_words = logical(de2bi(0:(npatterns-1)))';
% get the probabilities of all the possible patterns
logprobs = maxent.getLogProbability(model,unique_words);
probabilities = exp(logprobs);
% taking the values of all the unique words, reweighted by their probabilities,
% is equivalent to taking the observables of the model E_p[h(x)]:
marginals = maxent.getWeightedMarginals(unique_words,model,probabilities);
% the code above is functionally equivalent to calling:
% marginals = maxent.getMarginals(model)