How do I make a 3D surface from table data?
Mostra commenti meno recenti
Hello,
I have been struggling to create this 3D mesh and I hope someone can help me. I need to get the data from "Protons" on the X axis, the data from "Neutrons" on the Y axis and "Average binding energy" on the Z axis. I am new to Matlab and don't really understand how the code works, I have difficulties finding a way to put all the information in a form of x=[]; y=[]; z=[];. I figured there should be another way to use the data from the table but I have no clue how to do it.
Thank you in advance!
Atanas
1 Commento
Atanas
il 1 Ott 2023
Risposta accettata
Più risposte (1)
Rimisha
il 1 Ott 2023
0 voti
To create a 3D surface from table data in MATLAB, you can use the meshgrid function to generate coordinate matrices for the X and Y axes, and then use the surf function to plot the surface. Here's an example:
Matlab
% Assuming you have the data stored in variables protons, neutrons, and binding_energy
% Create coordinate matrices
[X, Y] = meshgrid(protons, neutrons);
% Reshape binding_energy into a matrix of the same size as X and Y
Z = reshape(binding_energy, size(X));
% Plot the surface
surf(X, Y, Z);
Regarding finding a suitable 3D function for the surface, it depends on the characteristics of your data. If you have prior knowledge or a theoretical model that suggests a specific function, you can fit the data to that function using curve fitting techniques. Otherwise, you can use interpolation methods to estimate values between data points.😊
1 Commento
Categorie
Scopri di più su Language Fundamentals in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
