[Solved] How can I plot these in matlab or R


Your question isn’t 100% clear, but I believe this is what you’re asking for. I’ve used Matlab.

len = 1000;
a_ = linspace(0, 5, len);
b_ = linspace(0, 5, len);
x = zeros(len);
for a = 1:len
    for b = 1:len
        val(1) = (a_(a)^2 * (1-b_(b))) / (a_(a) + b_(b) - a_(a)*b_(b)) + (1-a_(a))*a_(a);
        val(2) = a_(a)*b_(b) / (a_(a) + b_(b) - a_(a)*b_(b));
        val(3) = (1 - a_(a))^2;
        if max(val) == val(1)
            x(a,b) = 0.2;
        elseif max(val) == val(2)
            x(a,b) = 0;
        elseif max(val) == val(3)
            x(a,b) = 0.65;
        end
    end
end
imagesc(x)
colormap('hsv')
caxis([0 1])
set(gca, 'XTick', linspace(0, len, 5))
set(gca, 'YTick', linspace(0, len, 5))
set(gca, 'XTickLabel', linspace(0, 5, 5))
set(gca, 'YTickLabel', linspace(0, 5, 5))

I think this is right. I have no way of testing it unfortunately, but hopefully it does what you’re after. It’s possible I made a typo so let me know if it doesn’t work. Obviously you can change parts to suit you.

solved How can I plot these in matlab or R