indexing my answer into matrix form
조회 수: 1 (최근 30일)
이전 댓글 표시
how do i display my answer that is x0 (which is a 3x1 matrix) into a matrix where the rows are my x0 and the columns are my i,(number of iteration)
댓글 수: 2
채택된 답변
Walter Roberson
2020년 12월 24일
편집: Walter Roberson
2020년 12월 24일
format long g
for i = 1 : 10
%x0 = some calculation involving values indexed at i that gives a vector of length 3
x0 = [sin(2*pi*i+i/2), -cos(2*pi*i-i/2), cos(2*pi*i+i/2)*sin(2*pi*i-i/2)];
results(:,i) = x0;
end
disp(results)
t = array2table(results, 'rownames', {'x', 'y', 'z'}, 'VariableNames', "t="+string(1:size(results,2)))
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!