0

I would like to compare the gradients of different lineprofile at the same spot using Matlab. An example for a picture I am working with is the .tif file in the appendix. I marked two points in the png file where the gradient should be calculated. I would specify the x values because the y values will differ between the images. Is there a special operation I can use the gradient or is there a possibility to receive the y values from predefined x values in a lineprofile? I nearly have knowledge in using matlab but it will help me a lot if I knew what keywords I should look for.

Thank you in advance!

PNG:

lineprofile example.png

TIF:

lineprofile example.tif

Ander Biguri
  • 35,140
  • 11
  • 74
  • 120
toastflow
  • 13
  • 3
  • You have the data, forget about plots. You can access the data with simple indexing (`line(15)` or whatever) and the gradient between two points is just the simplest math operation ever, so no need to use any matlab "keyword" – Ander Biguri Jun 01 '20 at 11:34
  • Does line(15) mean, that I can receive the y value of the x value = 15? And will I have access with for example lineprofile.line(15) ? – toastflow Jun 01 '20 at 11:39
  • Yes it measn that. but no to your example. I just made up a variable called `line` as I do not know how your variable is called. Literally index your variable, its only purpose is having the values of y. It would be harder if you wanted this for an arbitrary mathematical construct, but you are obviously using images, thus integer indices are what you want. – Ander Biguri Jun 01 '20 at 11:41
  • Thank you a lot! I will try this – toastflow Jun 01 '20 at 11:42

0 Answers0