Create a 2D grid from two matrices.

7 visualizaciones (últimos 30 días)
Fiona
Fiona el 7 de Mzo. de 2016
Comentada: Fiona el 15 de Mzo. de 2016
I need to create a 2D mesh like the following:
I have a matrix (8x10 digits) with the x-values and a matrix of the corresponding y-values but am unsure how to go about making such a figure. Please note that this is not a surface rather just an irregular 2D grid.
Any help is appreciated!
  5 comentarios
Geoff Hayes
Geoff Hayes el 12 de Mzo. de 2016
Fiona - how do you expect to get the pattern that you have shown in the first image given the data from above? Do you have any other information that would allow you to create the "warped" mesh?
Fiona
Fiona el 15 de Mzo. de 2016
Hi Dr. Kolukula - Thank you very much for that! It has helped me a lot!
Hi Geoff - It is just alternate matrices e.g.
x =
NaN NaN NaN 50.3138 58.2592 66.5382 74.4113 82.1856 NaN NaN
NaN 34.1732 42.3385 50.1650 57.9590 66.2845 74.3104 82.0313 NaN NaN
25.4040 33.5838 42.1067 50.2883 58.3743 66.3658 74.3286 82.1521 90.0728 NaN
25.1809 33.2010 42.0916 50.1822 58.1800 66.5739 74.4494 82.3883 90.8429 NaN
24.2700 33.1020 41.5947 49.5275 57.7829 66.3376 74.3099 82.4189 91.0354 NaN
23.8320 32.8710 41.4931 49.0314 57.3284 66.0947 73.6572 81.9820 91.0566 98.2906
NaN 32.5039 41.2027 49.4193 56.7552 65.8748 73.7261 81.7959 91.1546 NaN
NaN NaN NaN NaN 57.1602 65.8605 73.3489 81.7461 90.2830 NaN
and
y =
NaN NaN NaN 16.3536 16.1013 15.9052 15.5072 14.9984 NaN NaN
NaN 24.6162 24.7030 24.8744 24.6290 24.0949 23.9129 23.1813 NaN NaN
31.7503 32.1427 32.2886 32.7160 33.2189 31.6883 31.6267 31.3343 30.7359 NaN
39.8911 39.7192 39.4006 39.6874 39.3796 39.0802 38.9713 38.4827 38.3843 NaN
48.2262 47.3420 47.0032 47.3153 47.4042 47.1318 46.7267 46.3659 46.3590 NaN
53.9719 55.0605 54.6965 54.4287 54.4090 54.3819 54.6384 54.7111 54.5891 54.1233
NaN 62.8494 62.5870 63.0312 62.8189 62.3447 62.5794 61.8617 62.2778 NaN
NaN NaN NaN NaN 71.4008 70.1461 71.0315 69.9867 70.1037 NaN

Iniciar sesión para comentar.

Respuesta aceptada

KSSV
KSSV el 8 de Mzo. de 2016
As you said you have 8X10 matrices of x and y. Use the function plotgrid from the link:

Más respuestas (0)

Categorías

Más información sobre NaNs en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by