# bifurcation diagram MATLAB runs out of memory

I have a 3000 x 2301 matrix 'xfinfin' in MATLAB that I want to plot in the following way:

for i=1:2301
ome = 0.4 + 0.001*(i-1);
plot(ome,xfinfin(:,i),'k.');
hold on
end


But this very quickly leads to MATLAB using 100% RAM and an error shows up in the MATLAB commnad line 'Out of memory'.

Basically, this algorithm plots a bifurcation diagram of omega vs x. How do I plot this without MATLAB runnning out of memory?

Thanks.

• I don't have access to MATLAB but even they take some time, in Octave, your codes run without error . I changed the line plot(ome,xfinfin(:,i),'k.'); as plot(ome*ones(3000,1),xfinfin(:,i),'k.'); which makes your codes faster You can try Octave. – Ömer Aug 24 '15 at 9:26
• Thank you. That small modification made the code run in Matlab itself without error. – zynga Aug 24 '15 at 9:47
• Do you know why this happened? – zynga Aug 24 '15 at 9:48
• I don't know exactly but probably the line plot(ome,xfinfin(:,i),'k.') eating so much memory. You can take a look at mathworks.com/help/matlab/matlab_prog/… – Ömer Aug 24 '15 at 10:07