------------------------------------------------------------------------------------------------------------------------------------
Example 12.1 Nonlinear Model:
------------------------------------------------------------------------------------------------------------------------------------
Eq. 12.19& Eq. 12.20:
------------------------------------------------------------------------------------------------------------------------------------
Eq. 12.22& Eq. 12.23:

2 commentaires

KSSV
KSSV le 31 Mai 2020
What have you attempted?
clc; clear; close all; format compact; format long eng;
rng('default');
% true signal curve
x = (0:.1e-4:2).';
y = .2 * ones(length(x),1) - x + .9 * x.^2 + .7 * x.^3 - .2 * x.^5;
% plot the true curve
%figure; plot(x1,y1,'b');
% training samples (20 or 500)
N = 20;
% sample interval [a b]
a = 0; b = 2;
% generate samples
x1 = (a : b/N : b - b/N).';
% noise generation
sigma_n = .05;
n = sqrt(sigma_n) .* randn(N,1);
% use the true theta
theta_true = [.2; -1; .9; .7; -.2];
% or a random one
theta_dstrbd = [-0.004; -10.54; 0.465; 0.087; -.093];
l = length(theta_true);
% compute the measurement matrix
Phi = [ones(N,1) x1 x1.^2 x1.^3 x1.^5];

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Get Started with MATLAB dans Centre d'aide et File Exchange

Produits

Version

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by