can u tell how to create this type of vector ?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
dpb
am 9 Aug. 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.
Antworten (1)
Daniel Shub
am 9 Aug. 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.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!