How do I make a 3D surface from table data?
์ด์ ๋๊ธ ํ์
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
Atanas
2023๋
10์ 1์ผ
์ฑํ๋ ๋ต๋ณ
์ถ๊ฐ ๋ต๋ณ (1๊ฐ)
Rimisha
2023๋
10์ 1์ผ
0 ๊ฐ ์ถ์ฒ
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
์นดํ ๊ณ ๋ฆฌ
๋์๋ง ์ผํฐ ๋ฐ File Exchange์์ 2-D and 3-D Plots์ ๋ํด ์์ธํ ์์๋ณด๊ธฐ
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
