Insights Blog
-- Browse All Articles --
Physics Articles
Physics Tutorials
Physics Guides
Physics FAQ
Math Articles
Math Tutorials
Math Guides
Math FAQ
Education Articles
Education Guides
Bio/Chem Articles
Technology Guides
Computer Science Tutorials
Forums
General Math
Calculus
Differential Equations
Topology and Analysis
Linear and Abstract Algebra
Differential Geometry
Set Theory, Logic, Probability, Statistics
MATLAB, Maple, Mathematica, LaTeX
Trending
Featured Threads
Log in
Register
What's new
Search
Search
Search titles only
By:
General Math
Calculus
Differential Equations
Topology and Analysis
Linear and Abstract Algebra
Differential Geometry
Set Theory, Logic, Probability, Statistics
MATLAB, Maple, Mathematica, LaTeX
Menu
Log in
Register
Navigation
More options
Contact us
Close Menu
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Forums
Mathematics
MATLAB, Maple, Mathematica, LaTeX
Bilinear spline interpolation MATLAB using MESHGRID and SURF
Reply to thread
Message
[QUOTE="kreil, post: 6259233, member: 19287"] Where does [itex]u_{ij}[/itex] come from? Should that be [itex]\Omega_{ij}[/itex]..? Assuming so, here is a program that does most of what you want, but that requires you to check the details: [code] function z = bilinearSpline(xx,yy,A,xq,yq) % --xx and yy are the sample grid points % --A is the image matrix, acting as values at the (xx,yy) locations % --xq and yq are the query points where the interpolation is performed. m = size(xq,1); % xq is also square z = zeros(size(xq)); % preallocate output for k = 1:m for p = 1:m % Pick query point x = xq(k,p); y = yq(k,p); u = A.*max(0,1-abs(x-xx)).*max(0,1-abs(y-yy)); % vectorize the summation over the values in A z(k,p) = sum(u,'all'); % Add all summation terms to find interpolated value end end % Plot result on the grid of query points surf(xq,yq,z) return % return result for z end[/code] You would call the function with the grid A is defined on for (xx,yy), and the points where you want to interpolate (xq,yq), e.g. [code] A = [69 110 196; 50 226 101; 210 100 206]; [xx,yy] = meshgrid(1:3); [xq,yq] = meshgrid(1:0.05:3); z = bilinearSpline(xx,yy,A,xq,yq) [/code] [/QUOTE]
Insert quotes…
Post reply
Forums
Mathematics
MATLAB, Maple, Mathematica, LaTeX
Bilinear spline interpolation MATLAB using MESHGRID and SURF
Back
Top