Borrar filtros
Borrar filtros

Plot a surface graph and interpolate between 2 variables

2 visualizaciones (últimos 30 días)
Zhenteng Shen
Zhenteng Shen el 22 de Mayo de 2020
Comentada: Ameer Hamza el 22 de Mayo de 2020
Hello all, thank you for taking the time to read my question, I am quite new to MATLAB)
So I have a material made from a blend of 2 concentrations of A and B. The concentrations of A used is (2.5% and 5%) and B is (1% and 1.5%). A matrix is formed when measuring the properties of each of the different combinations of the two blends. As shown below. The numerical results in green of the different combinations are c,d,e,f for example.
Now I would like to plot a 3D surface plot with A concentration on the x, B concentration on the y and the results on the z axis. How would I do that? I read about a meshgrid or plot3 function?
Also my other question is that now I have been given a numerical result and would like to interpolate to find the optimal concentration of A and B in the material respectively that can create this number, how would I do that?
Many thanks for your help!!

Respuesta aceptada

Ameer Hamza
Ameer Hamza el 22 de Mayo de 2020
You can plot a surface using something like this
A_conc = [2.5 5];
B_conc = [1 1.5];
M = [1 2;
1.5 2.5];
surf(A_conc, B_conc, M)
Similarly, to interpolate the data, you can use interp2
M_interp = interp2(A_conc, B_conc, M, 3, 1.25, 'spline') % spline interpolation
  8 comentarios
Zhenteng Shen
Zhenteng Shen el 22 de Mayo de 2020
Ah ok, I completely understand now from the diagram, thank you so much for taking the time to answer my question!
Ameer Hamza
Ameer Hamza el 22 de Mayo de 2020
I am glad to be of help!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Surface and Mesh Plots en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by