Integrating Two Unrelated Values
1 次查看(过去 30 天)
显示 更早的评论
Hi!
I am trying to integrate two different series that correlate to the same image. I was able to obtain X, Y, and Z values for an image in which the x-values correlate with length, the y-values correlate with width, and the z-values correlate with intensity. However, because these measurements are taken across a rectangular ROI, there are 528 x-values (length) and 504 y-values (width), as the object resembles 1/2 of an ellipse.
I would like the integrate these values so that I can plot (length x width x intensity) for my given shape. I have tried to integrate these values by plotting them on the same scatterplot, however I am not having a lot of sucess. I also am not having any luck finding code that will allow me to integrate these values.
Does anyone know an effective way to integrate two "unrelated" values?
1 个评论
Torsten
2024-7-16
Please include your data and your code. Your description of the problem is not helpful - maybe it's a language problem.
回答(1 个)
Karan Singh
2024-7-23
Hi Isabella,
It is very much not clear without the data being provided from your end. I am not able to get what these x and y values are and how you would like to visualize the same. However, taking everything to its basics, we can create a "surf" if it suits your case. You can definitely provide some more data for accurate suggestions. Here is my general go at a random "surf":
% Sample data (replace these with your actual X, Y, Z values)
x = linspace(0, 527, 528); % Length
y = linspace(0, 503, 504); % Width
z = rand(528, 504); % Intensity (Replace with your actual data)
% Create a meshgrid
[X, Y] = meshgrid(x, y);
% Transpose Z to match the shape of X and Y
Z = z';
% Create a 3D surface plot
figure;
surf(X, Y, Z);
% Add color bar
colorbar;
% Add labels
xlabel('Length');
ylabel('Width');
zlabel('Intensity');
% Set a colormap
colormap('jet');
% Adjust view angle
view(3);
% Show the plot
shading interp;
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!