Index problem help?

1 次查看(过去 30 天)
JL555
JL555 2015-9-22
编辑: JL555 2015-9-23
for i=1:n
for j=1:n
Pl=P(i)*B(i)(j)*P(j);
seems like i'm getting error with writing B(i)(j)...How will i code it in another way?

采纳的回答

Guillaume
Guillaume 2015-9-22
编辑:Guillaume 2015-9-22
Possibly, you meant to write
Pl(i,j) = P(i)*B(i,j)*P(j)
Or possibly, you meant something else entirely. It's impossible to tell with so little information.
In any case, you should go through the Getting Started tutorial.
Most likely also, the loops are not needed and it can all be done with matrix operations.
  17 个评论
Walter Roberson
Walter Roberson 2015-9-22
I am not familiar with economic load dispatch.
Note: I am not "dude". Or "man".
JL555
JL555 2015-9-23
编辑:JL555 2015-9-23
ok ..anyway thanks for your help really appreciate it.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by