how to do tedious mathematical calculation with matlab

조회 수: 3 (최근 30일)
Passband  Modulation
Passband Modulation 2012년 10월 5일
it is really tedious, probably impossible, to do the following equation using a calculator. Please note that cosine and sine functions are in degrees
the result should b a scalar value if i am right?
  댓글 수: 3
Walter Roberson
Walter Roberson 2012년 10월 5일
I see you have changed the wording of your question a little, and given the note about degrees, but the equation itself isn't there yet ?
Passband  Modulation
Passband Modulation 2012년 10월 5일
sry, i just reuploaded the image, could you now see the equation?

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

채택된 답변

Walter Roberson
Walter Roberson 2012년 10월 5일
k = 0:65119;
sum( cosd(3.6*k) .* sind(3.6*k) ).^2
  댓글 수: 1
Passband  Modulation
Passband Modulation 2012년 10월 5일
cool, it really works. actually, i just manage to obtain the result using
function [S] = sum1(n)
S = 0; % Initialize sum to zero
k = 0; % Initialize index to zero
% loop for calculating summation
while k <= 65119
S = S + cos(3.6*k*pi/180)*sin(3.6*k*pi/180); % add to summation
k = k + 1; % increase the index
end
and then square the outcome, and get the answer as urs.
cool, urs looks tidier. many thx

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by