There is no need for any interpolation, griddata, meshgrid, ndgrid, or changing the number of points. As long as the data is stored in order (i.e. not randomly) then you can just use reshape (and possibly a transpose, depending on the order of the data) and it will work just fine. All you need is just one line:
contourf(reshape(omega,4,4),reshape(M,4,4),reshape(eta,4,4))
Together with your example values:
omega = [107.841,153.211,228.0715,316.7175,117.0895,166.2985,247.9645,343.765,122.9353,174.6745,260.5285,364.1815,125.989,177.6410,267.334,373.6045];
M = [0.0911,0.1231,0.1785,0.2435,0.0628,0.0828,0.1159,0.1550,0.0412,0.0518, 0.0696,0.0902, 0.0319,0.0378,0.0480,0.0600];
eta = [0.4094,0.4466,0.4846,0.5076,0.4140,0.4554,0.4942,0.5218,0.3813,0.4167, 0.4601,0.4935,0.3460,0.3816,0.4174,0.4600];
contourf(reshape(omega,4,4),reshape(M,4,4),reshape(eta,4,4))
hold on
scatter(omega,M,'ro');
which give this plot
:
Best Answer