How to use loop to reduce the code?
이전 댓글 표시
clc
clear
syms t sigma
r = -4;
w = 2;
a = 1;
b = 1;
W = 1;
A_sin = 1;
A_sigma = [0,1;
-w^2,-a*((A_sin*sin(W*sigma)^2)/w^4)-b*x_2+r];
A_1 = int((A_sigma),sigma, 0, t) ;
A_2 = int((A_sigma*A_1),sigma, 0, t);
A_3 = int((A_sigma*A_2),sigma, 0, t);
A_4 = int((A_sigma*A_3),sigma, 0, t);
A_5 = int((A_sigma*A_4),sigma, 0, t);
phi = [1 0; 0 1]+ A_1+A_2+A_3+A_4+A_5;
The code I have is to integrate 5 times
How to write the for loop so that I can intergrate for 1000 times
Thank you!
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Programming에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!