indexing my answer into matrix form
1 view (last 30 days)
Show older comments
Muqhairie Marzuki
on 24 Dec 2020
Edited: Walter Roberson
on 24 Dec 2020
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 Comments
Accepted Answer
Walter Roberson
on 24 Dec 2020
Edited: Walter Roberson
on 24 Dec 2020
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 Comments
More Answers (0)
See Also
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!