indexing my answer into matrix form
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Muqhairie Marzuki
le 24 Déc 2020
Modifié(e) : Walter Roberson
le 24 Déc 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 commentaires
Réponse acceptée
Walter Roberson
le 24 Déc 2020
Modifié(e) : Walter Roberson
le 24 Déc 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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Matrix Indexing dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!