Evaluate a function with 6 variables at all data points

Hi,
I have a function such that f(x1,x2,..x6). I know the range of values taken by each of the variables x1,x2..x6. Each of them is a vector.
I want to calculate the function value at all combinations of xi's.
I know I can write a 6 layer loop and do this, but it consumes a lot of time.
For 2 variables I could have used meshgrid.
Also, inside the function definition, there is a definite integral for two of the variables. So the variables has to be passed as scalars.
Thank you

回答 (1 件)

Star Strider
Star Strider 2015 年 5 月 11 日

0 投票

With more than two vectors, you can use the ndgrid function.

カテゴリ

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

製品

質問済み:

2015 年 5 月 11 日

回答済み:

2015 年 5 月 11 日

Community Treasure Hunt

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

Start Hunting!

Translated by