Clear Filters
Clear Filters

Integrating Two Unrelated Values

7 views (last 30 days)
Isabella
Isabella on 16 Jul 2024
Answered: Karan Singh on 23 Jul 2024
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 Comment
Torsten
Torsten on 16 Jul 2024
Please include your data and your code. Your description of the problem is not helpful - maybe it's a language problem.

Sign in to comment.

Answers (1)

Karan Singh
Karan Singh on 23 Jul 2024
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;

Community Treasure Hunt

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

Start Hunting!