当前位置:网站首页>Day (8) of picking up matlab
Day (8) of picking up matlab
2022-04-23 15:54:00 【Sola_ Ex】
Pick up MATLAB The eighth day of
Matlab
One dimensional linear interpolation
One dimensional interpolation command
%x: Raw data ( The independent variables )n Dimension vector
%v: Raw data ( Function value )n Dimension vector
%xq: interpolation ( The independent variables ) Can make a point , It can also be a vector
%vq: Interpolation results ( Function value )
vq = interp1(x,v,xq)
vq = intterp1(x,v,xq,method)
method Methods
2014a Version of matlab At present, there are several methods :

give an example 1 — Interpolation method :

The implementation script code is as follows :
production = [75.995 ... .... ..] % Save here , In fact, it is the value of output
years = 1900:10:2010; % Set the year interval
x = 1900:2010;
p_res = interp1(years,production,x,'spline')
plot(years,production,'o',x,p_res)

Running can get a continuous line .
give an example 2 — Interpolation method :

The implementation script code is as follows :
x = 0:2:24;
y = [....] % Value of temperature
% Be careful :x and y The dimensions should be the same , Form a one-to-one correspondence
x1 = 0:1/3600:24 % In seconds , Increment of 1s
strmethod={
'nearest',...} % Method
strlb={
'{a}method=nearest',...} % Corresponding to the method above
for i=1:6
y1 = interp1(x,y,x1,strmethod{
i});
subplot(3,2,i) % Cut out 3*2 Pictures
plot(x,y,'ro',x1,y1,'b''linewith',1.5)
xlabel(strlb)
end
The effect is as follows :

版权声明
本文为[Sola_ Ex]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231554163987.html
边栏推荐
- JVM - Chapter 2 - class loader subsystem
- 单体架构系统重新架构
- CVPR 2022 quality paper sharing
- New developments: new trends in cooperation between smartmesh and meshbox
- PHP function
- MySQL - execution process of MySQL query statement
- Upgrade MySQL 5.1 to 5.66
- Merging of Shanzhai version [i]
- 贫困的无网地区怎么有钱建设网络?
- MySQL集群模式与应用场景
猜你喜欢

5 minutes, turn your excel into an online database, the magic cube net table Excel database

matplotlib教程05---操作图像

负载均衡器

C language self compiled string processing function - string segmentation, string filling, etc

CAP定理

Modèle de Cluster MySQL et scénario d'application

Distinct use of spark operator

C language --- string + memory function

Sortby use of spark operator

How can poor areas without networks have money to build networks?
随机推荐
Load Balancer
The biggest winner is China Telecom. Why do people dislike China Mobile and China Unicom?
一刷313-剑指 Offer 06. 从尾到头打印链表(e)
Master vscode remote GDB debugging
APISIX jwt-auth 插件存在错误响应中泄露信息的风险公告(CVE-2022-29266)
One brush 312 - simple repetition set - Sword finger offer 03 Duplicate number in array (E)
Upgrade MySQL 5.1 to 5.66
Go language slice, range, set
5分钟,把你的Excel变成在线数据库,神奇的魔方网表excel数据库
Spark 算子之sortBy使用
PS add texture to picture
C language --- string + memory function
北京某信护网蓝队面试题目
pywintypes. com_ Error: (- 2147221020, 'invalid syntax', none, none)
WPS brand was upgraded to focus on China. The other two domestic software were banned from going abroad with a low profile
时序模型:门控循环单元网络(GRU)
Pgpool II 4.3 Chinese Manual - introductory tutorial
Upgrade MySQL 5.1 to 5.69
PHP function
【现代电子装联期末复习要点】