fnval for tensor splines

2 ビュー (過去 30 日間)
Michael Brown
Michael Brown 2012 年 4 月 22 日
回答済み: Unai San Miguel 2017 年 3 月 15 日
I want to evaluate a tensor spline at a set of vector x(i),y(i) couples to get the vector z(i). The command fnval(pp,{x, y}) returns a matrix of all combinations of x and y. Is there a syntax to get the vector z(i) other than the not so elegant diag(fnval(pp,{x, y}) ) ?

回答 (1 件)

Unai San Miguel
Unai San Miguel 2017 年 3 月 15 日
fnval(pp, [x(:)'; y(:)'])?
From the fnval doc page
(...)
For an m-variate f with m>1, with f [d1,...,dr]-valued, x may be either an array, or else a cell array {x1,...,xm}.
  1. If x is an array, of size [n1,...,ns] say, then n1 must equal m, and v has size [d1,...,dr, n2,...,ns], with v(:,...,:, j2,...,js) the value of f at x(:,j2,...,js), – except that(1) d1, ..., dr is ignored in case f is scalar-valued, i.e., both r and n1 are 1;
(...)
In your case m = 2, d1 = 1, r = 1, [x(:)'; y(:)'] would be an array of size (2, length(x))

カテゴリ

Help Center および File ExchangeSpline Postprocessing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by