How to build this vector?
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Monkeyman
le 6 Mar 2018
Réponse apportée : Star Strider
le 6 Mar 2018
I am trying to create a 2 column vector with. I plan to this by creating a 1D vector for both columns and then putting them together.
Column 1: Integers 1 up to n (n having previously been inputted) This I have done easily: v1=[1:n]
Column 2: Corresponding values of each integer for the formula A = (1-1/n), I am really struggling with this, please can someone help me?
Cheers
0 commentaires
Réponse acceptée
Star Strider
le 6 Mar 2018
I hope this is not a homework assignment.
N = 10;
V1 = zeros(N, 2);
V1(:,1) = 1:N;
V1(:,2) = 1-1./V1(:,1);
0 commentaires
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!