MATLAB Answers

0

Create a matrix with Special properties

Asked by André Pacheco on 18 Dec 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)

  0 Comments

Sign in to comment.

1 Answer

Answer by Matt Fig
on 18 Dec 2012
Edited by Matt Fig
on 18 Dec 2012
 Accepted Answer

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]

  0 Comments

Sign in to comment.