Info

此问题已关闭。 请重新打开它进行编辑或回答。

Jus a simple expression (easy question)

1 次查看(过去 30 天)
Paul Rogers
Paul Rogers 2020-5-9
关闭: MATLAB Answer Bot 2021-8-20
Hi guys, I am just having some iussues with this formula, could some one please help me?
n=5, r=5.
  2 个评论
Ameer Hamza
Ameer Hamza 2020-5-9
What is M? How is defined? How is defined?
Paul Rogers
Paul Rogers 2020-5-9
编辑:Walter Roberson 2020-5-10
M doesn't matter, let's say aij is this matrix.
a =
1.7151 -0.1511 -0.0371 -0.0457 0.0323
0.5975 -0.0172 -0.0483 -0.0186 0.0064
0.0948 -0.0027 -0.0076 -0.0029 0.0010
0.0266 0.0003 -0.0032 -0.0009 0.0001
0.0064 0.0003 -0.0009 -0.0002 0.0000
Ti= cos(icos^-1(i))
Tj= cos(icos^-1(j))
n=5
r=5

回答(1 个)

Ameer Hamza
Ameer Hamza 2020-5-9
Try this
a = [...
1.7151 -0.1511 -0.0371 -0.0457 0.0323
0.5975 -0.0172 -0.0483 -0.0186 0.0064
0.0948 -0.0027 -0.0076 -0.0029 0.0010
0.0266 0.0003 -0.0032 -0.0009 0.0001
0.0064 0.0003 -0.0009 -0.0002 0.0000];
n=5;
r=5;
i = 0:r-1;
j = 0:n-11;
Ti= cos(i.*acos(i));
Tj= cos(i.*acos(i));
result = sum(a.*Ti.'.*Tj, 'all')
Result
result =
54.6082
  4 个评论
Walter Roberson
Walter Roberson 2020-5-10
Is the for j=r correct? Should it be for j=1:r ?
Ameer Hamza
Ameer Hamza 2020-5-10
Thanks for correction. It should be 1:r

此问题已关闭。

产品


版本

R2014b

Community Treasure Hunt

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

Start Hunting!

Translated by