Functions involving column vectors

I have 3 column vectors like this
A = [1 2 3 ... m]'
B = [1 2 3 ... n]'
C = [1 2 3 ... o]'
And I have another variable W related with A, B and C using the following function:
W = C^2 * (1 + C) * (1 + C*A) * (1 + C*B) / (2 + C)
I would like to find all values of W for all possible values of A, B and C. Also, how can I plot the result as a 3D figure with color intensity representing the value of W on it? I have tried several methods but none seems to work so far.

回答 (1 件)

Andrei Bobrov
Andrei Bobrov 2016 年 12 月 19 日

0 投票

One way:
[ii,jj,k] = ndgrid(A,B,C);
W = C.^2 * (1 + C) .* (1 + C.*A) .* (1 + C.*b) ./ (2 + C);

カテゴリ

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

質問済み:

2016 年 12 月 19 日

回答済み:

2016 年 12 月 19 日

Community Treasure Hunt

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

Start Hunting!

Translated by