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!