当前位置:网站首页>【MATLAB】绘制泽尼克多项式
【MATLAB】绘制泽尼克多项式
2022-04-21 07:16:00 【今天不飞了】
上次只给了公式没有给代码,很多小伙伴表示不是很认可。今天直接把代码发上来了
by HPC_ZY
公式
代码
生成泽尼克多项式的函数(归一化)
% 生成泽尼克多项式的函数
function [x,y,z] = getZernikeBasicFunc()
x = -1:0.01:1;
[x,y] = meshgrid(x);
[theta,r] = cart2pol(x,y);
z{
1} = ones(size(x)).*1/sqrt(pi);
z{
2} = r .* cos(theta).*2/sqrt(pi);
z{
3} = r .* sin(theta).*2/sqrt(pi);
z{
4} = r.^2 .* cos(2.*theta).*sqrt(6/pi);
z{
5} = (2.*r.^2 - 1) .* sqrt(3/pi);
z{
6} = r.^2 .* sin(2.*theta) .* sqrt(6/pi);
z{
7} = r.^3 .* cos(3.*theta) .* sqrt(8/pi);
z{
8} = (3.*r.^3 - 2.*r) .* cos(theta) .* sqrt(8/pi);
z{
9} = (3.*r.^3 - 2.*r) .* sin(theta) .* sqrt(8/pi);
z{
10} = r.^3 .* sin(3.*theta) .* sqrt(8/pi);
z{
11} = r.^4 .* cos(4.*theta) .* sqrt(10/pi);
z{
12} = (4.*r.^4 - 3.*r.^2) .* cos(2.*theta) .* sqrt(10/pi);
z{
13} = (6.*r.^4 - 6.*r.^2 + 1).*sqrt(5/pi);
z{
14} = (4.*r.^4 - 3.*r.^2) .* sin(2.*theta).*sqrt(10/pi);
z{
15} = r.^4 .* sin(4.*theta).*sqrt(10/pi);
for n = 1:15
z{
n}(r>1) = nan;
z{
n} = z{
n}/max(abs(z{
n}(:)));
end
使用方法与显示
% 生成
[x,y,z] = getZernikeBasicFunc();
% 两种显示方式
figure
for n = 1:15
subplot(3,5,n),pcolor(x,y,z{
n}), shading interp
axis square
axis off
colorbar
end
figure
for n = 1:15
subplot(3,5,n),mesh(x,y,z{
n}), shading interp
axis square
colorbar
end
其他
没别的了
版权声明
本文为[今天不飞了]所创,转载请带上原文链接,感谢
https://blog.csdn.net/xsz591541060/article/details/124275188
边栏推荐
- [Ethernet switching security] - port security and MAC address drift prevention and detection
- Accidentally found a Tsinghua sister's database!
- PHP Chinese to English initials
- An entity class maps a field
- The interface is not restored after Fiddler changes the font
- Return value iresult of standard function
- ESmodule规范入门
- Sword finger offer day22 bit operation (medium)
- 天梯赛L3
- TypeScript函数泛型
猜你喜欢

Usage of go ini

The listview column in C automatically adapts to the perfect effect of scaling

Win10 prompts that there is no mapping between account name and security ID

Technical background and practical role of "industrial digitization"

无意中发现了一位清华妹子的资料库!

J'ai accidentellement trouvé la base de données d'une soeur Tsinghua!

Access-Control-Allow-Credentials:true 和 预检请求

Display selection reference ladder

BurpSuite工具详解及暴库示例

从零开始学习C语言日记——DAY27扫雷
随机推荐
Music download and other file names have become the same name solution
Valentina Studio Pro for Mac(mac数据库管理软件)
天梯赛L3
树的基本概念与存储结构
类中的泛型以及泛型类型
Usage of go language log Uber go / zap / lumberjack
图片素材 免费素材 图片素材网站 图片素材在哪里找 哪里有的图片素材下载 图片素材的用途 图片素材 产品图片素材网站 什么的素材可以 PPT素材
数据库实验一、数据库的创建及基本查询
Picture material free material picture material website picture material where to find some picture material download the purpose of picture material picture material product picture material website
【知行】浅谈Switch与If
Mysql双主双从+Atlas数据测试
shell脚本之正则表达式
go-ini的用法
无意中发现了一位清华妹子的资料库!
[2022dasctf x Su] Web replay of March spring challenge
Sword finger offer day22 bit operation (medium)
Web development related libraries or software
Actual combat of cloud native kubesphere multi tenant system
Why is the primary key matching setting in MySQL showing that I am wrong?
在Win10系统中用mimikatz抓取明文密码