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

 Réponse acceptée

Image Analyst
Image Analyst le 3 Déc 2014

0 votes

14 commentaires

amberly hadden
amberly hadden le 3 Déc 2014
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 le 4 Déc 2014
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 le 4 Déc 2014
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 le 4 Déc 2014
Thank you very very much. I'ill try this it looks very reasonable.
Thanks again
amberly hadden
amberly hadden le 4 Déc 2014
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 le 5 Déc 2014
great thanks very much
amberly hadden
amberly hadden le 8 Déc 2014
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 le 8 Déc 2014
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 le 8 Déc 2014
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 le 9 Déc 2014
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 le 9 Déc 2014
Modifié(e) : Image Analyst le 9 Déc 2014
hi its producing same data set insread
solved my problem
:) Thanks

Connectez-vous pour commenter.

Plus de réponses (0)

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by