How to define a symbolic function for this equation?

1 回表示 (過去 30 日間)
moaad
moaad 2023 年 1 月 2 日
編集済み: Dyuman Joshi 2023 年 1 月 2 日
Where, p_{i,j} are data points.
Where P_ij are data points.
  4 件のコメント
Kone
Kone 2023 年 1 月 2 日
m and n are not very clear in the function though. Is p_ij a 2D or 3D vector?
Dyuman Joshi
Dyuman Joshi 2023 年 1 月 2 日
編集済み: Dyuman Joshi 2023 年 1 月 2 日
How will you multiply x^i*y^j and P_ij? The first term is numeric or symbolic, and the latter term is a cell.
I don't understand what is it that you are trying to do.
I presume that P_ij is a 2D cell array with each element having 3 values for 3 co-ordinates.

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

回答 (1 件)

Kone
Kone 2023 年 1 月 2 日
You can use the 'syms' function to create symbolic variables for each of the inputs and then use them to define the function. The 'subs' function can also help evaluate particular values of your variables.
something like this
syms x y p_ij;
S(x, y, p_ij) = x .* y .* p_ij
S(x, y, p_ij) = 
Ans = subs(S, [x, y, p_ij], [3,3,{1}])
Ans(x, y, p_ij) = 
9

カテゴリ

Help Center および File ExchangeSymbolic Variables, Expressions, Functions, and Preferences についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by