matlab中stc,Scattered translates collocation matrix

2023-11-01 13:10

本文主要是介绍matlab中stc,Scattered translates collocation matrix,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

stcol

Scattered translates collocation matrix

Syntax

colmat = stcol(centers,x,type)

colmat = stcol(...,'tr')

Description

colmat = stcol(centers,x,type) is the

matrix whose (i,j)th entry is

ψj(x(:,i)),i=1:size(x,2),j=1:n

with the bivariate functions ψj and the

number n depending on the centers and the

character vector type, as detailed in the description of

stmak.

centers and x must be matrices with the same

number of rows.

The default for type is the character vector

'tp', and for this default, n equals

size(centers,2), and the functions

ψj are given by

ψj(x)=ψ(x−centers(:,j)),j=1:n

with ψ the thin-plate spline basis function

ψ(x)=|x|2log|x|2

and with |x| denoting the Euclidean norm of the vector

x.

Note

See stmak for a description of

other possible values for type.

The matrix colmat is the coefficient matrix in the linear

system

∑jajψj(x(:,i))=yi,i=1:size(x,2)

that the coefficients aj of the function

f =

Σjajψj

must satisfy in order that f interpolate the value

yi at the site

x(:,i), all i.

colmat = stcol(...,'tr') returns the

transpose of the matrix returned by stcol(...).

Examples

Example 1. The following evaluates and plots the

function

f(x)=ψ(x−c1)+ψ(x−c2)+ψ(x−c3)−3.5ψ(x)

on a regular mesh, with ψ the above thin-plate basis function,

and with c1,

c2,

c3 three points on the unit circle;

see the figure below.

a = [0,2/3*pi,4/3*pi]; centers = [cos(a), 0; sin(a), 0];

[xx,yy] = ndgrid(linspace(-2,2,45));

xy = [xx(:) yy(:)].';

coefs = [1 1 1 -3.5];

zz = reshape( coefs*stcol(centers,xy,'tr') , size(xx));

surf(xx,yy,zz), view([240,15]), axis off

9ace5e5cf59a48d7e01509dc9cffdf88.png

Example 2. The following also evaluates, on the

same mesh, and plots the length of the gradient of the function in Example 1.

zz = reshape( sqrt(...

([coefs,0]*stcol(centers,xy,'tp10','tr')).^2 + ...

([coefs,0]*stcol(centers,xy,'tr','tp01')).^2),

size(xx));

figure, surf(xx,yy,zz), view([220,-15]), axis off

这篇关于matlab中stc,Scattered translates collocation matrix的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/323204

相关文章

matlab读取NC文件(含group)

matlab读取NC文件(含group): NC文件数据结构: 代码: % 打开 NetCDF 文件filename = 'your_file.nc'; % 替换为你的文件名% 使用 netcdf.open 函数打开文件ncid = netcdf.open(filename, 'NC_NOWRITE');% 查看文件中的组% 假设我们想读取名为 "group1" 的组groupName

利用matlab bar函数绘制较为复杂的柱状图,并在图中进行适当标注

示例代码和结果如下:小疑问:如何自动选择合适的坐标位置对柱状图的数值大小进行标注?😂 clear; close all;x = 1:3;aa=[28.6321521955954 26.2453660695847 21.69102348512086.93747104431360 6.25442246899816 3.342835958564245.51365061796319 4.87

C# double[] 和Matlab数组MWArray[]转换

C# double[] 转换成MWArray[], 直接赋值就行             MWNumericArray[] ma = new MWNumericArray[4];             double[] dT = new double[] { 0 };             double[] dT1 = new double[] { 0,2 };

[论文笔记]LLM.int8(): 8-bit Matrix Multiplication for Transformers at Scale

引言 今天带来第一篇量化论文LLM.int8(): 8-bit Matrix Multiplication for Transformers at Scale笔记。 为了简单,下文中以翻译的口吻记录,比如替换"作者"为"我们"。 大语言模型已被广泛采用,但推理时需要大量的GPU内存。我们开发了一种Int8矩阵乘法的过程,用于Transformer中的前馈和注意力投影层,这可以将推理所需

libsvm在matlab中的使用方法

原文地址:libsvm在matlab中的使用方法 作者: lwenqu_8lbsk 前段时间,gyp326曾在论坛里问libsvm如何在matlab中使用,我还奇怪,认为libsvm是C的程序,应该不能。没想到今天又有人问道,难道matlab真的能运行libsvm。我到官方网站看了下,原来,真的提供了matlab的使用接口。 接口下载在: http://www.csie.ntu.edu.

Matlab/Simulink中PMSM模型的反电动势系数和转矩系数

Matlab/Simulink中PMSM模型的反电动势系数和转矩系数_matlab pmsm-CSDN博客

MATLAB层次聚类分析法

转自:http://blog.163.com/lxg_1123@126/blog/static/74841406201022774051963/ 层次聚类是基于距离的聚类方法,MATLAB中通过pdist、linkage、dendrogram、cluster等函数来完成。层次聚类的过程可以分这么几步: (1) 确定对象(实际上就是数据集中的每个数据点)之间的相似性,实际上就是定义一个表征

MATLAB的fix(),floor()和ceil()函数的区别与联系

fix(x),floor(x)和ceil(x)函数都是对x取整,只不过取整方向不同而已。 这里的方向是以x轴作为横坐标来看的,向右就是朝着正轴方向,向左就是朝着负轴方向。 fix(x):向0取整(也可以理解为向中间取整) floor(x):向左取整 ceil(x):向右取整 举例: 4个数:a=3.3、b=3.7、c=-3.3、d=-3.7 fix(a)=3 fl

MATLAB中的eig函数

在MATLAB中,计算矩阵A的特征值和特征向量的函数是eig(A),常用的调用格式有5种: E=eig(A):求矩阵A的全部特征值,构成向量E。 [V,D]=eig(A):求矩阵A的全部特征值,构成对角阵D,并求A的特征向量构成V的列向量。 [V,D]=eig(A,'nobalance'):与第2种格式类似,但第2种格式中先对A作相似变换后求矩阵A的特征值和特征向量,而格式3直接求矩阵A的特

MATLAB中的diag函数

diag函数功能:矩阵对角元素的提取和创建对角阵 设以下X为方阵,v为向量 1、X = diag(v,k)当v是一个含有n个元素的向量时,返回一个n+abs(k)阶方阵X,向量v在矩阵X中的第k个对角线上,k=0表示主对角线,k>0表示在主对角线上方,k<0表示在主对角线下方。例1: v=[1 2 3]; diag(v, 3) ans =      0     0     0