필터 지우기
필터 지우기

How to compare values between two NxM matrices

조회 수: 3 (최근 30일)
Christopher
Christopher 2024년 6월 18일
댓글: Christopher 2024년 6월 18일
Hello everyone!
I'm still pretty new to MatLab, and am getting familiar with how to operate it, so I am looking for some ideas as to how to best tackle this problem. It seems like a FOR loop to compare the minimums would be the best way to tackle this, but I'm not sure.
I have two matrixes that I need to examine for a discrepancy between expected altitude and measured altitude. I need to compare a matrix of DEM data (1x1920) against a matrix of retrieved altitudes (820x1920). I need to index the columns where there the altitude plots below the DEM, and examine the difference between the two matrices.
The example below provides an outline of the problem. The white line represents recorded DEM data, and the curtain represents the data I need to examine to determine if there was an error with the recorded altitude. For example, the DEM data below, idx(1,563) shows .5767, and the altitude at that same point shows idx(773,563) shows a value of 1.0735. So there is no numerical correlation between the value of the DEM and the value of the altitude (since it seems more akin to a bar graph).
Any help getting started with this would be much appreciated!
  댓글 수: 4
Umar
Umar 2024년 6월 18일
You can adapt this code snippet to your specific data and further analyze the identified columns to understand the discrepancies between the altitude and DEM data. This should help you get started on tackling the problem efficiently in Matlab.
Christopher
Christopher 2024년 6월 18일
Thank you for providing the basis for a loop! I adapted it, and it reported that every column had a difference, so I'll have to make sure I look at indexing the end of the altitude data and comparing against the appropriately indexed DEM data.

댓글을 달려면 로그인하십시오.

채택된 답변

Voss
Voss 2024년 6월 18일
discrepancy_columns = find(any(altitude_data<DEM_data,1));
  댓글 수: 1
Christopher
Christopher 2024년 6월 18일
Thank you for providing a starting point! I'll make sure I adapt this code so that it loops through the matrices and finds areas where there is a discrepancy.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

제품


릴리스

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by