How to find two variable function from scattered data?

11 ビュー (過去 30 日間)
Sergiusz Lorys
Sergiusz Lorys 2017 年 3 月 6 日
コメント済み: Sergiusz Lorys 2017 年 3 月 13 日
Hi everyone!
I am getting started with MatLab and I would be very grateful if you can help me. How can I find approximating function of this 3D plot?
This is plot of my data which I need to approximate. In a book, I have found that this data should be approximated with two variable polynominal like this:
How can I solve this equations with my data in matlab?
Regards, Sergiusz.
  1 件のコメント
Rik
Rik 2017 年 3 月 6 日
If you have the symbolic toolbox, you can try solve.

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

採用された回答

Walter Roberson
Walter Roberson 2017 年 3 月 6 日
function Avals = approximate_f5(nbar, Z, mbar)
nbar = nbar(:); Z = Z(:); mbar = mbar(:);
nZ = length(Z);
A = [ones(nZ, 1), nbar, nbar.^2, nbar.^3, nbar.*Z, nbar.^2.*Z, nbar.*Z.^2, Z, Z.^2, Z.^3];
b = mbar;
Avals = A\b;
  9 件のコメント
Walter Roberson
Walter Roberson 2017 年 3 月 13 日
Generally, you can use a From Workspace to read data in Simulink. However, Simulink does not read graphic objects, so you would have to calculate into variables instead.
Simulink generally works based on time steps, so you have to decide whether you are wanting to do these calculations and treat the results like constants for the Simulink session, or if you are wanting the values to be used somehow based upon input signals in Simulink. For example you might want to generate it all before Simulink and then use the calculated values as part of an N-D Lookup block (that is, interpolate based upon input values), or you might be looking to generate coefficients that are used in a Fcn (Arithmetic Block) or MATLAB Function Block... or you might be thinking of having Simulink read the values sequentially...
Sergiusz Lorys
Sergiusz Lorys 2017 年 3 月 13 日
Ok, I get it. Thank you very much again! I really appreciate that!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGeneral Applications についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by