当前位置:网站首页>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
边栏推荐
- Function summary of drawing object arrangement in R language
- C语言自编字符串处理函数——字符串分割、字符串填充等
- Application case of GPS Beidou high precision satellite time synchronization system
- 捡起MATLAB的第(7)天
- 布隆过滤器在亿级流量电商系统的应用
- leetcode-396 旋转函数
- C#,贝尔数(Bell Number)的计算方法与源程序
- The biggest winner is China Telecom. Why do people dislike China Mobile and China Unicom?
- Codejock Suite Pro v20.3.0
- Temporal model: long-term and short-term memory network (LSTM)
猜你喜欢

C language --- string + memory function

How important is the operation and maintenance process? I heard it can save 2 million a year?

Website pressure measurement tools Apache AB, webbench, Apache jemeter

Filter usage of spark operator

IronPDF for . NET 2022.4.5455

Why is IP direct connection prohibited in large-scale Internet

Sortby use of spark operator

一文掌握vscode远程gdb调试

Coalesce and repartition of spark operators

Treatment of idempotency
随机推荐
贫困的无网地区怎么有钱建设网络?
Redis master-slave replication process
现在做自媒体能赚钱吗?看完这篇文章你就明白了
Neodynamic Barcode Professional for WPF V11. 0
Multi level cache usage
shell_ two
MySQL - MySQL查询语句的执行过程
MySQL - execution process of MySQL query statement
大型互联网为什么禁止ip直连
计算某字符出现次数
Coalesce and repartition of spark operators
Large factory technology implementation | industry solution series tutorials
【开源工具分享】单片机调试助手(示波/改值/日志) - LinkScope
多生成树MSTP的配置
[open source tool sharing] MCU debugging assistant (oscillograph / modification / log) - linkscope
Merging of Shanzhai version [i]
Accumulation of applet knowledge points
One brush 314 sword finger offer 09 Implement queue (E) with two stacks
Intersection, union and difference sets of spark operators
MySQL Cluster Mode and application scenario