Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

MATLAB Programming Work Task: Write a MATLAB program for polynomial fitting Item: Excel file with the x and y data include Step: 1. Import the excel file with row-data, where row A for X-axis and row...

1 answer below »
MATLAB Programming Work
Task: Write a MATLAB program for polynomial fitting
Item: Excel file with the x and y data include
Step:
1. Import the excel file with row-data, where row A for X-axis
and row B for Y-axis
2. Use MATLAB functions to extract the polynomial function of
the curve
Figure to plot:
Equation to extract:
  XXXXXXXXXX ...
n
np x p p x p x p x
    
An equation with an order of 20 is prefe
ed, where n = 20.
3. Next, use the extracted equation to output row data with the
-5.00E-01
0.00E+00
5.00E-01
1.00E+00
1.50E+00
XXXXXXXXXX
ID
(A
m
m
)
VD(V)
following:
 
0 ~ 20, 0.1x step
y p x
 

4. Please set for auto generate an excel file for the output data
Answered Same Day Sep 28, 2021

Solution

Rahul answered on Sep 28 2021
171 Votes
clc;
clear all;
% Import the Excel File
data = xlsread('polynomial-ujbdlyas.xlsx');
% Extract the x and y data
x = data(:,1);
y = data(:,2);
% Use polyfit with three outputs to fit polynomial using centering and scaling,
% Centering and scaling improves the numerical properties of the problem.
% polyfit centers the data to avoid the ill condition
[p,~,mu] = polyfit(x,y,19);
% Find the fitted y values using the coefficient p
y1 =...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here