can u tell how to create this type of vector ?
조회 수: 1 (최근 30일)
이전 댓글 표시
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
dpb
2013년 8월 9일
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.
답변 (1개)
Daniel Shub
2013년 8월 9일
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
참고 항목
카테고리
Help Center 및 File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!