I want to input the formula below into MATLAB to ultimately commpute 'W':
Can you please tell me if how can I correct my code or suggest a more concise one?
syms i
for i = 1:m
i = i + 1;
phi(i) = atan((d1+(i*d2/(m+1)))/(R/(3*m+3)));
W = symsum(sin(gama + ((pi/2) - (phi*i))), i, 1, m);
end

 채택된 답변

Ameer Hamza
Ameer Hamza 2020년 4월 5일

0 개 추천

This numerically estimate the summation
d1 = 0.1; % example values
d2 = 0.5;
R = 1;
phi_i = @(ii, m) atan((d1 + (ii*d2)./(m+1))./(R/(3*(m+1))));
W = @(m, delta) sum(sin(delta + pi/2 - phi_i(1:m, m)));
W(10, 2)

댓글 수: 1

Jay
Jay 2020년 4월 6일
I have to add a new variable beta_i to the original equation, where beta = 2 x phi.
Beta is also indexed: I did B_i = 2*phi_i
Can you please tell me how can I multiplly phi_i directly by a scalar to get the betas?
phi_i = @(ii, m) atan((d1 + (ii*d2)./(m+1))./(R/(3*(m+1))));
H = @(m) cos(gama) + sum(cos(gama + (pi/2 - phi_i))) +...
omega *sin(B(m)).

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Matrix Indexing에 대해 자세히 알아보기

제품

릴리스

R2017a

질문:

Jay
2020년 4월 5일

댓글:

Jay
2020년 4월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by