フィルターのクリア

Can you please explain these line of code?

2 ビュー (過去 30 日間)
Mohammad Wajih
Mohammad Wajih 2015 年 1 月 3 日
編集済み: Mohammad Wajih 2015 年 1 月 14 日
fid = fopen( geomFile );
xPos = zeros(1,geoSize);
for kk = 1:geoSize;
xPos(kk) = fread( fid, 1, '*uint32' );
end
fclose(fid);
max_xPos = max(xPos);
xdim = max_xPos - min_xPos +1;
Any kind of help is appreciated!!

採用された回答

Geoff Hayes
Geoff Hayes 2015 年 1 月 3 日
Mohammad - why not step through the code to see what is happening? A file is opened, three matrices are sized, then an x and y an z coordinate is read for each element in the three matrices. The file is closed, and the min and max (x,y,z) coordinate is found. For more information on each function type the following in the Command Window
doc fopen
doc fread
doc fclose
doc min
doc max
As for why the code is doing this, hopefully you have an idea on that! :)
  4 件のコメント
Mohammad Wajih
Mohammad Wajih 2015 年 1 月 4 日
Thank you Mr. Hayes for your answer. Actually, I don't know who the author of this code is. This code used to work for me but now I don't know why its not working. So, I am trying to understand each and every line. Thanks for your response. I really appreciate it.
Image Analyst
Image Analyst 2015 年 1 月 4 日
I agree with Geoff: calling them dim is a horrible name for the variables since it's really the range of the data, not the dimensions. For example if the data range from 1000 to 1005, that does not mean that the dimension of an array to hold all that data should be 6 - there could be hundreds of pixels in that range. But you really have to define what "its not working" means to you for us to fix it.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeText Data Preparation についてさらに検索

タグ

タグが未入力です。

Community Treasure Hunt

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

Start Hunting!

Translated by