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 个评论
pinak parida
pinak parida 2013-8-9
forget G can you do for
X(i)={x(1,i),x(2,i),x(3,i)........x(D,i)}
dpb
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
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.

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by