当前位置:网站首页>【数学建模】基于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
边栏推荐
- Recommend a simple browser tab
- Introduction to SSH Remote execution command
- 为什么要做特征的归一化/标准化?
- Reading a line from ifstream into a string variable
- 记录在模拟器中运行flutter时报的错
- Hard disk monitoring and analysis tool: smartctl
- Reappearance of ASPP (atlas spatial pyramid pooling) code
- 2022-2028 global sepsis treatment drug industry research and trend analysis report
- After the festival, a large number of people change careers. Is it still time to be 30? Listen to the experience of the past people
- NFT new opportunity, multimedia NFT aggregation platform okaleido will be launched soon
猜你喜欢

Okaleido, a multimedia NFT aggregation platform, is about to go online, and a new NFT era may come

Opencv learning notes (continuously updated)

Analysis of the reasons why enterprises build their own software development teams to use software manpower outsourcing services at the same time

SQL: special update operation

PyTorch中在反向传播前为什么要手动将梯度清零?

How to quickly view the inheritance methods of existing models in torchvision?

KINGS

CTO and programmer were both sentenced for losing control of the crawler

Zhengda futures news: soaring oil prices may continue to push up global inflation

Su embedded training - Day10
随机推荐
041. (2.10) talk about manpower outsourcing
application
Torch learning notes (5) -- autograd
After the festival, a large number of people change careers. Is it still time to be 30? Listen to the experience of the past people
Record: solve the problem that MySQL is not an internal or external command environment variable
Scrapy爬虫框架
Boost. Asio Library
A green plug-in that allows you to stay focused, live and work hard
189. Rotation array
235. The nearest common ancestor of the binary search tree [LCA template + same search path]
[combinatorics] dislocation problem (recursive formula | general term formula | derivation process)*
2022-2028 global solid phase extraction column industry research and trend analysis report
What is SQL get connection
4. Load balancing and dynamic static separation
flask 生成swagger文档
Integrated easy to pay secondary domain name distribution system
Reading a line from ifstream into a string variable
Raft 日志复制
leetcode:556. 下一个更大元素 III【模拟 + 尽可能少变更】
變化是永恒的主題