How to define variable that itself contains one or more variables ?

How can I find b(ijk) for different values of i,j,k by just entering values of i,j,k.
b(ijk) = d/dq(k) [m(ij)] q(1), q(2), q(3).......are variables
How can we define variable in a variable ( q(k) , m(ij) ) ?

5 件のコメント

James Tursa
James Tursa 2014 年 7 月 7 日
Can you give more detail? What are the dimensions of d, dq, q, m? How do you want those combined to form b? Maybe give an example for one specific element of b.
dpb
dpb 2014 年 7 月 7 日
Is a variable "in" a variable a cell array???
Alish
Alish 2014 年 7 月 9 日
qk is a family of variables. Substituting different values of k we get different q ( example q1, q2, q3 etc )
Alish
Alish 2014 年 7 月 9 日
Basically i want to define a family of equations bijk = d/dqk[mij]
where d/dqk is partial derivative wrt qk Now if i sustitute i=1 j =2 k=3 i get
b123=d/dq3[m12]
where q3 is a variable m12 is an element of a matrix
In the same way we can obtain b231, b212, b113 etc.
So basically how can i define a family of variables qk which itself contains a variable k ?
dpb
dpb 2014 年 7 月 9 日
See
doc function_handle % (@)
for perhaps a way to proceed.

サインインしてコメントする。

回答 (1 件)

Jos (10584)
Jos (10584) 2014 年 7 月 9 日

0 投票

You do not want to store things like Q1 = .. Q2 = .. .. Q98293 = .. in gazillion different, but related, variables
You want a single array Q, which can be an array of doubles, cells, structures.

カテゴリ

ヘルプ センター および File ExchangeVariables についてさらに検索

質問済み:

2014 年 7 月 7 日

コメント済み:

dpb
2014 年 7 月 9 日

Community Treasure Hunt

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

Start Hunting!

Translated by