The first step
>> monitorData = permute( reshape( hun, 2,[] ), [2,1] );
>> monitorData
monitorData =
4×2 cell array
{'chocolate' } {[40]}
{'strawberry jam'} {[50]}
{'dulce de leche'} {[45]}
{'halva' } {[60]}
without comments and the final step
>> s = sum([monitorData{:,2}])
s =
195
>> monitorData(:,2) = cellfun( @(n) 100*n/s, monitorData(:,2), 'uni',false )
monitorData =
4×2 cell array
{'chocolate' } {[20.5128]}
{'strawberry jam'} {[25.6410]}
{'dulce de leche'} {[23.0769]}
{'halva' } {[30.7692]}