Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8506129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:30:40+00:00 2026-06-11T02:30:40+00:00

I am trying to use 2D polynomial fitting for my table data, my data

  • 0

I am trying to use 2D polynomial fitting for my table data, my data format is exactly like the link below:
http://www.mathworks.de/help/toolbox/curvefit/brx2ldg-1.html#bso46rp-1

I mean I have vector X with length n, Y with length m and m*n Matrix Z, I would like to fit 5 degree 2d polynomial to my data,

I am wondering that is there any syntax in MATLAB for solving this problem? like SFIT command in IDL, http://star.pst.qub.ac.uk/idl/SFIT.html

I have cftool and sftool, but it seems that they don’t work for this purpose or most probably I don’t know how to employ them.

and I know that there some m.file which people share in MATLAB Mathworks file exchange, please if you know one works properly, suggest me.

I’d appreciate any help and comment.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T02:30:42+00:00Added an answer on June 11, 2026 at 2:30 am

    You can use polyfitn from file exchange and re-format your data in order to have 3 MxN x,y,z vectors.

    Example:

    Assume you have a table data of the form

    N = 100; M = 80;
    x = linspace(0, 1, M);
    y = linspace(0, 1, N).';
    z = bsxfun(@franke, x, y);
    

    Create meshgrid for x, and y instead

    N = 100; M = 80;
    [x, y] = meshgrid(0:1:N, 0:1:M);
    z = bsxfun(@franke, x, y);
    

    (Note that unique(x) and unique(y) will give you the original linspace values of your table rows and columns.)

    Use polyfitn to get the 5-degree polynomial coefficients

    p = polyfitn([x(:),y(:)], z(:), 5);
    

    You can additionally convert the result into a symbolic form to view the polynomial using the provided polyn2sym(p)

    >> pretty(polyn2sym(p))
    
                          5                           4                             4                         3   2
         90264379051097 X1         2537627280433653 X1  X2       7778045812403061 X1       6982058230382053 X1  X2
    - ------------------------- - -------------------------- + ------------------------ - -------------------------- + ...
      2417851639229258349412352   38685626227668133590597632   604462909807314587353088   77371252455336267181195264
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying use mod_rewrite to rewrite URLs from the following: http://www.site.com/one-two-file.php to http://www.site.com/one/two/file.php The
I'm trying use epoch time dates in my series data. The array looks like
I am trying use this example http://www.sajithmr.me/jrecorder/example2.html for recording audio and send it to
I am need paint my image. I'm trying use JQuery in here this link:
Trying to use records with the cursor and later index by table in the
I'm trying use to selenium with firefox on CentOS from command line like this:
I am trying use the jQuery table sorter plugin for a table that is
I am trying to use RSM and calculate 3rd order polynomials.for quadratic below is
i'm trying use facebook API to upload photo in my fan page. I downloaded
I am trying use gem tire to search in my application. I have tables

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.