How can I use for_loops & if_statement condition on an image ?

1 view (last 30 days)
Hello, hope you're doing well.
I need to read an image from a fit_file (Kindly find the attached image) as a matrix. The x-axis is the time in seconds (Number of columns), the y-axis is the frequency (Number of rows), and the values in cells are the intensity's values (The z-axis). It is a spectrum figure to show the intensity for a signal at a specific frequency and time.
I want to define the following :
1. A variable called "T" which denotes to all columns (x-axis). 2. A variable called "F" which denotes to all rows (y-axis). 3. A variable called "I" which denotes to all values inside the cells (z-axis).
And make for_loops to read (Scan) all rows, all columns, and all values inside cells. And then make if_statements to procedure the following conditions :
1. If the value inside a cell at a specific "t" and "f" is > "I_min" and also < "I_max" and f1 = 0 & t1 = 0, then make f1 = f & t1 = t. 2. If the value inside a cell at a specific "t" and "f" is > "I_min" and also < "I_max" and f1 > 0 & t1 > 0, then make f2 = f & t2 = t. "I_min and I_max are values to be defined later".
The objective is to define the start and end points of the curve (The red curve in the image) and generalize the process for any image like that. i.e. Scan the matrix and determine the start and end points for the curve.
All that I have done until this moment is just reading the fit_file and display the image as a matrix and I don't know how to continue.
Please I want an explanation in details step-by-step to continue writing the code.
Kind Regards ...

Answers (0)

Community Treasure Hunt

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

Start Hunting!