Hello every body,
I'm new with Matlab. I want to write a code whcih can be used on my grid file to reduce it to region of my interest. I have lat lon and displacement values. I want to define a circle of radius 100Km from a central point(lat lon) so that everything outside the circle delete and I get a resultant grid file with data of my own interest.
I would like to pay some reward (as Im a student) for this work.
Please let me know if anybody is interested
Thanks

 채택된 답변

Image Analyst
Image Analyst 2014년 12월 3일

0 개 추천

댓글 수: 14

amberly hadden
amberly hadden 2014년 12월 3일
Thanks image analyst
but this is for image I have a very large grid file which is giving me error when I do meshgrid (out of memory)
Image Analyst
Image Analyst 2014년 12월 4일
How big is it? How many points across and vertically do you have? What does your displacement data look like. Please read this
amberly hadden
amberly hadden 2014년 12월 4일
I'm sorry I dont what to do and how to ask as I'm stressed.
My data file is having 3 columns and 3070250 rows (lat,lo,displacement).
Thanks for guidence
What does displacement have to do with anything? Just read in the file, compute distances and keep those that are closer than 100. Something like
m = importdata(filename);
x = m(:, 1);
y = m(:, 2);
% Define reference point. Could be whatever you want.
xRef = x(1);
yRef = y(1);
% Find distances of every point from the ref point
distances = sqrt((x-xRef).^2+(y-yRef).^2);
% Find rows closer than 100
indexesOfClosePoints = distances < 100;
% Extract only those
closePoints = m(indexesOfClosePoints, :);
amberly hadden
amberly hadden 2014년 12월 4일
Thank you very very much. I'ill try this it looks very reasonable.
Thanks again
amberly hadden
amberly hadden 2014년 12월 4일
Hi Image analyst
Could you please guide me how can I find the location of a point lets say lat lon z, I want maximum z which will be max(A(:,3)) now I want to locate its position and then want to get values of (lat and lon) at max z. In next step I want to reffer these values as as xRef and Yref
Thanks in advance :)
[maxZ, indexOfMaxZ] = max(z);
xRef = x(indexOfMaxZ);
yRef = y(indexOfMaxZ);
amberly hadden
amberly hadden 2014년 12월 5일
great thanks very much
amberly hadden
amberly hadden 2014년 12월 8일
Dear image anlyst
I was trying to write a small code in which I just want to select part of data. lets say attached file. I just want to select region between
58.4818969729 26.9251161301 1.6595774889 and 58.497736653 26.9251161301 1.1188951731
can anybody help me in this regard
Thanks in advance Amberly
Image Analyst
Image Analyst 2014년 12월 8일
I don't see any attached file. Did you forget to click the "Attach file" button after you browsed to it?
If it's a follow up question, attach it above by editing your question. If it's totally unrelated to this question, then post a new question.
amberly hadden
amberly hadden 2014년 12월 8일
Sorry I did uploaded and yes your are right :) forget to click attached. I did posted a new question but didt get any response you can browse title of it Sampling data from a large data file Thanks
amberly hadden
amberly hadden 2014년 12월 9일
Hey! can you see file now
Try this code:
numbers = xlsread('test.xls');
lats = numbers(:, 1);
lons = numbers(:, 2);
z = numbers(:, 3);
lat1 = 58.4
lon1 = 26.1
z1 = 1.65
lat2 = 58.5
lon2 = 27
z2 = 1.11
desiredLats = lats >= lat1 & lats <= lat2
desiredLons = lons > lon1 & lons <= lon2
desiredZs = z <= z1 & z >= z2
rowsToExtract = desiredLats & desiredLons & desiredZs
extractedRows = numbers(rowsToExtract, :)
amberly hadden
amberly hadden 2014년 12월 9일
편집: Image Analyst 2014년 12월 9일
hi its producing same data set insread
solved my problem
:) Thanks

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

추가 답변 (0개)

질문:

2014년 12월 3일

편집:

2014년 12월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by