indexing my answer into matrix form
2 次查看(过去 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)
采纳的回答
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!