Matlab Matrix plot from a for-loop
조회 수: 1 (최근 30일)
이전 댓글 표시
Foto Hello everyone! I just need to make a matrix from my code. The x from 1 to 30 is actually my index. I need a proper y filled with zeros allong and only at i index filled with X Value. Hopefully you could understand me.
댓글 수: 3
답변 (1개)
KALYAN ACHARJYA
2021년 11월 14일
pi_aprox=zeros(1,30);
n=6;
g2n=zeros(1,30);
U_neue=zeros(1,30);
g2n(1)=1;
for i=1:30
U_neue(i)=n*g2n(i);
pi_aprox(i)=U_neue(i)/2;
n=n*2;
g2n(i)=sqrt(2-sqrt(4-g2n(i)^2));
end
Please change as per requirements
댓글 수: 4
KALYAN ACHARJYA
2021년 11월 14일
편집: KALYAN ACHARJYA
2021년 11월 14일
x=1:1:30;
y=zeros(1,30);
plot(x,y);
Any sense?
참고 항목
카테고리
Help Center 및 File Exchange에서 Assembly에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!