can u tell how to create this type of vector ?

1 visualizzazione (ultimi 30 giorni)
pinak parida
pinak parida il 8 Ago 2013
I want a vector like
X(i,G)={x(1,i,G),x(2,i,G),x(3,i,G)........x(D,i,G)}
where
i=1,2....10
D=1,2....10
G=0
xmin=-5*rand(1,10)
xmax=5*rand(1,10)
j=1,2,....D
x(j,i,0)=xmin(j)+rand()*(xmax(j)-xmin(j))
  3 Commenti
pinak parida
pinak parida il 9 Ago 2013
forget G can you do for
X(i)={x(1,i),x(2,i),x(3,i)........x(D,i)}
dpb
dpb il 9 Ago 2013
Do what, precisely? I can't fathom what it is you're really after.
Do an actual full example of inputs/outputs and how you get from one to the next.

Accedi per commentare.

Risposte (1)

Daniel Shub
Daniel Shub il 9 Ago 2013
For your simplified question
X(i)={x(1,i),x(2,i),x(3,i)........x(D,i)}
lets let i equal 1 and D equal 5, x(1,1) equal to a, x(2,1) equal to b, ... x(5,1) equal to e, then we get.
X(1)={a,b,c,d,e}
but you probably don't really want {} braces, since this is a special thing in MATLAB.
X=[a,b,c,d,e]
now if a equals 10, and b equals 20, ... and e equals 50, then
x = [10, 20, 30, 40, 50]
In summary I have no idea what you are trying to do, but you might want to read the some (if not all) of the getting started documentation.

Categorie

Scopri di più su Get Started with MATLAB in Help Center e File Exchange

Tag

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by