Create a matrix with Special properties

1 vue (au cours des 30 derniers jours)
André Pacheco
André Pacheco le 18 Déc 2012
Hello,
I want to generate a matrix that looks like this
V0=10
a=5
matrix=[V0 ,random_number_between_-100_140, a ,(V1) , (V1), random_number_between_-100_140, a ,(V2)]
Where V1=(V0 + random_number_between_-100_140 + a) and V2= (V1+ random_number_between_-100_140 + a)

Réponse acceptée

Matt Fig
Matt Fig le 18 Déc 2012
Modifié(e) : Matt Fig le 18 Déc 2012
V0 = 10;
a = 5;
V1 = V0 + randi([-100 140]) + a;
V2 = V1 + randi([-100 140]) + a;
matrix = [V0,randi([-100 140]),a,V1,V1,randi([-100 140]),a,V2]

Plus de réponses (0)

Catégories

En savoir plus sur Matrices and Arrays 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!

Translated by