Question

I have a 6x7 matrix and codes as shown below.

AAA = [6.58334819836268e-08,6.58360422229042e-08,1.00000000000000e-07,6.58360422229042e-08,6.58334819836268e-08,6.52045800754157e-08,5.85884775603342e-08;6.58357144702898e-08,7.07877183955584e-15,1.30107757091448e-14,7.07877183955584e-15,6.58357144702898e-08,6.54972575310103e-08,5.93117733834096e-08;6.58339625800589e-08,3.11222470705387e-14,1.00000000000000e-07,3.11222470705387e-14,6.58339625800589e-08,6.53071149110581e-08,5.91467960666378e-08;3.35180697959755e-14,1.23401983330586e-13,3.16992910945127e-07,1.23401983330586e-13,3.35180697959755e-14,6.42575733502040e-08,5.51860031243273e-08;2.60334109648121e-14,3.15652463329506e-13,3.06020237241310e-07,3.15652463329506e-13,2.60334109648121e-14,6.13091171475941e-08,4.67547677521445e-08;1.34421509504861e-13,3.68888581036477e-13,2.99436633019020e-07,3.68888581036477e-13,1.34421509504861e-13,5.41463382985084e-08,3.24989206785054e-08];

[xx,yy] = meshgrid(0:71:426,0:71:355);

mesh(xx,yy,AAA)

A graph can be plotted by running the above code without any problem at all. However, when I interpolated it as show below, an error occurred and the graph cannot be shown. What did I do wrong? Help me please.

[xxx,yyy] = meshgrid(0:1:426,0:1:355);

InterpAAA = interp2(xx,yy,AAA,xxx,yyy);

mesh(xxx,yyy,InterpAAA)
Was it helpful?

Solution

This may be related to a graphical limitation of your system. Your code didn't work for me either (Maverick IMac 2012b), but the following did

mesh(xxx, yyy, InterpAAA*100) %multiply the data by 1e2 - OK
mesh(xxx, yyy, InterpAAA*10) %multiply the data by 1e2 - NOT OK

I guess it might be due to the rendering method. You can try invoking set(gcf,'renderer','paint');. It works on my machine, but it is very slow.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top