当前位置:网站首页>【数学建模】基于matlab船舶三自由度MMG模型【含Matlab源码 1925期】
【数学建模】基于matlab船舶三自由度MMG模型【含Matlab源码 1925期】
2022-07-03 18:48:00 【海神之光】
一、获取代码方式
获取代码方式1:
完整代码已上传我的资源:【数学建模】基于matlab船舶三自由度MMG模型【含Matlab源码 1925期】
获取代码方式2:
通过订阅紫极神光博客付费专栏,凭支付凭证,私信博主,可获得此代码。
备注:
订阅紫极神光博客付费专栏,可免费获得1份代码(有效期为订阅日起,三天内有效);
二、部分源代码
function main
M = 20000000; %两千万 X 两千万 矩阵
f1 = @()sinfun1(M);
f2 = @()sinfun2(M);
f3 = @()sinfun3(M);
f4 = @()sinfun4(M);
sprintf('f1-无预分配for循环用时:%f',timeit(f1))
sprintf('f2-有预分配for循环用时:%f',timeit(f2))
sprintf('f1/f2倍数:%f',timeit(f1)/timeit(f2))
sprintf('f3-无预分配向量用时:%f',timeit(f3))
sprintf('f4-有预分配向量用时:%f',timeit(f4))
sprintf('f2/f4倍数:%f',timeit(f2)/timeit(f4))
sprintf('f1/f4倍数:%f',timeit(f1)/timeit(f4))
function y = sinfun1(M)
x = 0:M - 1;
for k = 1:numel(x)
y(k) = sin(x(k) / (100*pi));
end
function y = sinfun2(M)
x = 0:M-1;
y = zeros(1, numel(x));
for k = 1:numel(x)
y(k) = sin(x(k) / (100*pi));
end
三、运行结果

四、matlab版本及参考文献
1 matlab版本
2014a
2 参考文献
[1]李昕.MATLAB数学建模[M].清华大学出版社.2017
[2]王健,赵国生.MATLAB数学建模与仿真[M].清华大学出版社.2016
[3]余胜威.MATLAB数学建模经典案例实战[M].清华大学出版社.2015
边栏推荐
- 235. 二叉搜索树的最近公共祖先【lca模板 + 找路径相同】
- Flutter网络和数据存储框架搭建 -b1
- 2022.02.11
- Suffix derivation based on query object fields
- leetcode:11. 盛最多水的容器【双指针 + 贪心 + 去除最短板】
- Record: pymysql is used in pycharm to connect to the database
- How can I avoid "div/0!" Errors in Google Docs spreadsheet- How do I avoid the '#DIV/0!' error in Google docs spreadsheet?
- Transformer T5 model read slowly
- leetcode:11. Container with the most water [double pointer + greed + remove the shortest board]
- flask 生成swagger文档
猜你喜欢

2022-2028 global marking ink industry research and trend analysis report

Administrative division code acquisition

MySQL duplicate check

There are several levels of personal income tax

我们做了一个智能零售结算平台

my. INI file not found

The online customer service system developed by PHP is fully open source without encryption, and supports wechat customer service docking

我眼中真正优秀的CTO长啥样

Xception for deeplab v3+ (including super detailed code comments and original drawing of the paper)
![[Godot] add menu button](/img/44/ef1e6ac25bcbc8cc3ecc00c52f8ee2.jpg)
[Godot] add menu button
随机推荐
CTO and programmer were both sentenced for losing control of the crawler
204. Count prime
Shell script return value with which output
C enum contains value - C enum contains value
Su embedded training - Day10
Web3 credential network project galaxy is better than nym?
High concurrency Architecture - read write separation
SSH 远程执行命令简介
Torch learning notes (3) -- univariate linear regression model (self training)
为什么要做特征的归一化/标准化?
A green plug-in that allows you to stay focused, live and work hard
my. INI file not found
CV in transformer learning notes (continuously updated)
2022-2028 global marking ink industry research and trend analysis report
Which do MySQL and Oracle learn?
Caddy server agent
Help change the socket position of PCB part
NFT新的契机,多媒体NFT聚合平台OKALEIDO即将上线
Understanding of database architecture
Reading a line from ifstream into a string variable