Prev: Delete Rows using if condition
Next: Warning: Texture data too large... problem with alphadata in
From: John D'Errico on 11 Aug 2010 16:30 "Richard " <REMOVETHISrcaldwellie(a)yahoo.com> wrote in message <i3ujjg$pfu$1(a)fred.mathworks.com>... > Hi, I'm having difficulty with the interp1 command. Just don't get it! I've a set(actually very many sets) of values in an array with x and y coordinates 5. I want to interpolate and generate data with a resolution of 1. My data is of the form: > 0 0 avalue > 5 0 avalue > 10 0 avalue > . > . > 0 5 avalue > 5 5 avalue > 10 5 avalue > 15 5 avalue > avalue is an electric field strength and I need to generate the filed values at the points > 1 0 newval > 2 0 newval > 3 0 newval > 4 0 newval > .. > and so on > How do I implement this with interp1 Think of it like this. Why would you use a ONE dimensional interpolation tool to interpolate TWO dimensional data? help interp2 John
From: Richard on 12 Aug 2010 04:44 "Matt J " <mattjacREMOVE(a)THISieee.spam> wrote in message <i3ur0b$k66$1(a)fred.mathworks.com>... > "Richard " <REMOVETHISrcaldwellie(a)yahoo.com> wrote in message <i3uqku$r35$1(a)fred.mathworks.com>... > > > x y field_strength > > where x and y are coordinates in 2d space. I have a 400metre X 400 metre area but only have data for every 5th point(i.e. 5 metre resolution) > ================= > > Like I said, > > interp2(0:5:400,0:5:400, field_strength, 0:400,0:400); Thanks Matt. That worked, but i had to use meshgrid(0:400) for the XI and YI values. It just returned a vector otherwise
From: Matt J on 12 Aug 2010 10:16 "Richard " <REMOVETHISrcaldwellie(a)yahoo.com> wrote in message <i40c8n$235$1(a)fred.mathworks.com>... > Thanks Matt. That worked, but i had to use meshgrid(0:400) for the XI and YI values. It just returned a vector otherwise ================= No, you didn't have to use meshgrid, but the vector output was my fault. I should have written interp2(0:5:400,0:5:400, field_strength, 0:400,(0:400).'); %Note transpose
First
|
Prev
|
Pages: 1 2 Prev: Delete Rows using if condition Next: Warning: Texture data too large... problem with alphadata in |