当前位置:网站首页>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
边栏推荐
- One brush 313 sword finger offer 06 Print linked list from end to end (E)
- Interview questions of a blue team of Beijing Information Protection Network
- Named in pytoch_ parameters、named_ children、named_ Modules function
- MySQL集群模式与应用场景
- Go concurrency and channel
- 捡起MATLAB的第(10)天
- gps北斗高精度卫星时间同步系统应用案例
- Tencent offer has been taken. Don't miss the 99 algorithm high-frequency interview questions. 80% of them are lost in the algorithm
- Master vscode remote GDB debugging
- Implement default page
猜你喜欢
Why is IP direct connection prohibited in large-scale Internet
捡起MATLAB的第(8)天
C语言自编字符串处理函数——字符串分割、字符串填充等
Vision of building interstellar computing network
Groupby use of spark operator
The principle and common methods of multithreading and the difference between thread and runnable
Use bitnami PostgreSQL docker image to quickly set up stream replication clusters
Intersection, union and difference sets of spark operators
ESP32编译环境的搭建
Import address table analysis (calculated according to the library file name: number of imported functions, function serial number and function name)
随机推荐
字符串最后一个单词的长度
Basic greedy summary
提取不重复的整数
Neodynamic Barcode Professional for WPF V11. 0
5分钟,把你的Excel变成在线数据库,神奇的魔方网表excel数据库
一刷312-简单重复set-剑指 Offer 03. 数组中重复的数字(e)
Do we media make money now? After reading this article, you will understand
IronPDF for .NET 2022.4.5455
leetcode-374 猜数字大小
糖尿病眼底病变综述概要记录
运维流程有多重要,听说一年能省下200万?
贫困的无网地区怎么有钱建设网络?
Leetcode-396 rotation function
Go concurrency and channel
Load Balancer
Spark 算子之filter使用
【第5节 if和for】
Pgpool II 4.3 Chinese Manual - introductory tutorial
Metalife established a strategic partnership with ESTV and appointed its CEO Eric Yoon as a consultant
Upgrade MySQL 5.1 to 5.69