필터 지우기
필터 지우기

what does this code mean?

조회 수: 1 (최근 30일)
Ruben Verkempynck
Ruben Verkempynck 2011년 5월 2일
Hey everybody, I copied a piece of code and I am trying to translate this code to formulas in excel but I am having a hard time trying to transform this part of code:
SSB(t)=((N(:,t).*exp((-FKA*f)+(-M02*m))).*MAKA)'*WAKA;
N is 9 x 31 FKA is 9 x 1 M02 is 9 x 1 MAKA is 9 x 1 WAKA is 9 x 1
Can anyone explain to me the steps in this column? And what do the stars and dots mean?
Cheers, Ruben

채택된 답변

Paulo Silva
Paulo Silva 2011년 5월 2일
. before operation means that the operation is element wise
[a b].*[c d]=[a*c b*d]
' means transpose (columns turn into rows and rows into columns)
[a b]'=[a;b]
: means every element of column or row, it depends if it's before or after the comma, there are also other uses.
M(:,1) means all rows of column 1 and M(1,:) means all columns of row 1
M(:) means all elements of the array M
It can also be used to create vectors like this
v=1:0.1:10; %creates a vector with elements starting at 1 with 0.1 increment and ending at 10
M(1:10); %get the first 10 elements of the array M
Now you can understand your expression, I won't do it because by doing it you will learn better.
  댓글 수: 2
Oleg Komarov
Oleg Komarov 2011년 5월 2일
You meant [a*c b*d]
Paulo Silva
Paulo Silva 2011년 5월 2일
yes thanks, silly typo lol

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Dialog Boxes에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by