Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

How to put all the values of a for loop in a vector?

조회 수: 1 (최근 30일)
Delshad Ayoubi
Delshad Ayoubi 2017년 10월 13일
마감: MATLAB Answer Bot 2021년 8월 20일
I want D_N to get another value in each loop and then put that value in a vector, T amount of times. Basically, I want to be able to go through the script an T amount of times and each time D_N will get another value and then put it into a vector. How do I do this?
clear
clc
N = 100;
M = 2000;
B = zeros(M,N);
for m=1:M
x_t(1) = 0;
for n = 1:N
A = sign(randn);
x_t(n+1) = x_t(n) + A;
B(m,n) = x_t(n);
end
hold on
end
C = B(:,end);
D = C.^2;
D_N = sqrt(mean((D)))

답변 (0개)

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by