1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
abruzzese [7]
3 years ago
10

In this problem, we want to represent the relationship between the input of a system, x, and its output, y, using a polynomial.

A set of 21 system measurement data pairs were obtained and saved in the MATLAB file xyg1.mat.
To solve this problem, design and write a MATLAB function named polyfitsystem.m that has the following requirements:

1. The function must have the following input arguments:

a. x containing the input measurement data
b. y containing the output measurement data
c. R2 the minimum desired coefficient of determination resulting from the curve fitting calculations

2. The function must have the following output arguments:

a. z containing the coefficients of the fitting polynomial
b. N the degree of the polynomial
c. R2 the actual coefficient of determination resulting from the curve fitting calculations.

You may use the MATLAB built-in functions polyfit and polyval inside your user-defined function polyfitsystem.

To test your function, write a MATLAB script that calls your polyfitsystem function using the provided data and the following examples of minimum desired values for R2
Physics
1 answer:
alexandr402 [8]3 years ago
5 0

Answer:

clc

clear all

close all

format long

A=load('xyg1.mat');

x=A(:,1);

y=A(:,2);

[z,N,R2]=polyfitsystem(x,y,0.95)

function [z,N,R2]=polyfitsystem(x,y,R2)

for N=1:20

z=polyfit(x,y,N);

SSR=sum((y-polyval(z,x)).^2);

SST=sum((y-mean(y)).^2);

s=1-SSR/SST;

if(s>=R2)

R2=s;

break;

end

end

xx=linspace(min(x),max(x));

plot(x,y,'o',xx,polyval(z,x));

xlabel('x');

ylabel('y(x)');

title('Plot of y vs x');

end

Explanation:

You might be interested in
If two asteroids moved closer together, what would be the result on the gravitational force each asteroid exerts on the other?
spayn [35]
Gravitational force depends on inverse square law. That is, gravitational force is inversely proportional to square of distance between asteroids.
As distance between them decreases, gravitational force increases. Hence A is correct.
7 0
3 years ago
Read 2 more answers
Longitudinal waves transfer energy ___________ to the direction of the wave motion.
viva [34]
Longitudinal waves transfer energy parallel to the direction of the wave motion
4 0
3 years ago
Read 2 more answers
Mars has a mass of about 6.4 x 1023 kg, and its moon Phobos has a mass of about 9.6 x 1015 kg. If the magnitude of the gravitati
Sliva [168]

Answer:9.55×10^-4 metre

Explanation:

8 0
4 years ago
A person jogs 4.0 km in 32 minutes, then 2.0 km in 22 minutes, and finally 1.0 km in 16 minutes. What is the jogger's average sp
kupik [55]

Answer:

22

Explanation:

i did it before

7 0
4 years ago
Water is pumped through a pipe of diameter 15.0 cm, from the Colorado River up to Grand Canyon Village, located on the rim of th
Aleksandr [31]

Answer:

p= 1.50289×10⁷ N/m²

Explanation:

Given

HA = (564 m)................(River Elevation)

HB = (2096 m).............(Village Elevation)

Area = A =(π/4){Diameter}² = (π/4){0.15 m}² = 0.017671 m²

ρ = (1 gram/cm³) = (1000 kg/m³)........(Water Density)

p(pressure)=?

Solution

p=PA - PB

p= ρ*g*HB - ρ*g*HA

p= (ρ*g)*(HB - HA)

p= (1000×9.81 )×{2096  - 564}  

p= 1.50289×10⁷ N/m²

8 0
3 years ago
Other questions:
  • Which location is MOST LIKELY to be struck by a hurricane? A) Charleston, South Carolina B) San Diego, California C) Buffalo, Ne
    13·1 answer
  • Does a physical change affect the identity of a substance? Does a chemical change affect the identity of a substance?
    5·1 answer
  • Will give brainliest!!
    7·1 answer
  • A fox is 7 meters from the base of a tree that is 15 m tall. A nest of owls is at the top of the tree. One of the owlets tosses
    13·1 answer
  • What happens when you dip open bottle in bucket full of water?why​?<br>chapter=pressure​
    5·1 answer
  • Plasma easily conducts electricity and responds to magnetic fields, but why?
    13·1 answer
  • True or false? Magnetic reversals are recorded in the newly formed oceanic crust on BOTH sides of a mid-ocean ridge spreading ce
    10·1 answer
  • An experiment was devised to investigate the effects on the temperature of a cup of coffee when cream is added at different time
    11·2 answers
  • How to create a mirror from a clear glass? BRAINLIEST for the correct answer!!!
    10·1 answer
  • Entific findings are useful
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!