当前位置:网站首页>[matlab] draw Zernike polynomials
[matlab] draw Zernike polynomials
2022-04-22 05:03:00 【I won't fly today】
【MATLAB】 Drawing Zernike polynomials
Last time, I only gave the formula, not the code , Many partners said they didn't agree very much . Send the code directly today
by HPC_ZY
The formula
Zernike in Cartesian coordinates (Zernike) coefficient
Code
Functions that generate Zernike polynomials ( normalization )
% Functions that generate Zernike polynomials
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
Usage and display
% Generate
[x,y,z] = getZernikeBasicFunc();
% Two display modes
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
other
Nothing else
版权声明
本文为[I won't fly today]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210716215570.html
边栏推荐
- 常见的测试方式
- Junit断言
- Introduction to swagger UI
- JUnit common notes
- [boutique] using dynamic agent to realize unified transaction management
- Transaction isolation level and mvcc
- If the answer is yes or no, do you want to use one checkbox or two radio boxes? Which is more appropriate? Why?
- cv2.drawContours()、cv2.findContours()、cv2.boundingRect(img)函数用法解析
- [stack and queue] simple application of C language ⌊ stack and queue realize each other, circular queue ⌉
- Realization of online Preview PDF file function
猜你喜欢
![[stack and queue] simple application of C language ⌊ stack and queue realize each other, circular queue ⌉](/img/ac/d0d76fd109a53da73c624631f90c00.png)
[stack and queue] simple application of C language ⌊ stack and queue realize each other, circular queue ⌉

Final Cut Pro mosaics in multiple places of the video at the same time

Introduction to JUnit

Nexus private server - (III) using private server warehouse in project practice
Apple plans to expand children's information and communication security features to the UK and Canada

What is the difference between two-dimensional convolution kernel and three-dimensional convolution kernel in convolution neural network?

Junit簡介與入門
![C language simple [stack and queue] (bracket matching problem)](/img/3d/092daf5d4896aabaf12d34497fe643.png)
C language simple [stack and queue] (bracket matching problem)

Speech feature extraction of emo-db dataset

Several key points of logistic regression
随机推荐
Linear regression API
Alibaba cloud performance test PTS new features in March
Regular expression validation
If you can convert a two-dimensional array into a one-dimensional array gracefully and quickly, or convert a multi-dimensional array into a one-dimensional array
Introduction to swagger UI
Download of resource accp-s1 boot3 development tool
Carina 的根基與誕生背景|深入了解 Carina 系列 第一期
RestFul风格的API设计
Discussion on data set division
VIM is so difficult to use, why are so many people keen?
博云 BeyondCMP 云管理平台 5.6 版本发布
Inotify Brief
KNN prediction minimum case summary
在线预览PDF文件功能实现
What is the difference between two-dimensional convolution kernel and three-dimensional convolution kernel in convolution neural network?
Write down the daily temperature
Chapter 2 MySQL data types and operators
Programme de démarrage Spark: WordCount
JUnit common notes
Several key points of logistic regression