Design Matrix set up

7 次查看(过去 30 天)
Emilee Burris
Emilee Burris 2019-3-21
I am creating a desgin matrix for a data set and I have this equation
y(t)=a1 + a2 exp(-(t-0.0001)/50^2) + a3 sin(2π(60)t)
When I am entering it into matlab I keep getting error and I don't know what I am doing wrong.
Code:
X=(2*pi*(60)*t);
A = [ones(length(t),1) exp(-((t-0.0001)/50).^2)' sin(2*pi*(60)*t)];
Output:
Error using horzcat
Dimensions of arrays being concatenated are not consistent.
  4 个评论
Emilee Burris
Emilee Burris 2019-3-23
t is a vector of values
Walter Roberson
Walter Roberson 2019-3-23
Before the assignment to X, insert
t = t(:);
That should fix the problem.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Operators and Elementary Operations 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by