一種比較好的抗鋸齒算法
Add myaa.m to your path and enjoy anti-aliased professionally looking graphics in Matlab at any time. Myaa works with any kind of graphic (3-D, plots, scatterplots, ...) and even adds anti-aliasing to text, ui controls and grids. Myaa is ideal for complex, cluttered and saturated plots.
See attached screenshot for a demonstration. More examples included in the code, just run help myaa .
Curiosa:
For those of you who publish your code often, an undocumented anti-aliasing Option is included in the snapnow.m function in Matlab. To publish a file called test.m you can do:
opts.figureSnapMethod = antialiased
publish( test.m ,opts)
However, you will have more control over the process using myaa, which is also the best choice when using Matlab interactively.
標簽:
professionally
anti-aliased
graphics
looking
上傳時間:
2016-09-28
上傳用戶:txfyddz
河內塔問題
#include<stdio.h>
#include<stdlib.h>
int fun_a(int)
void fun_b(int,int,int,int)
int main(void)
{
int n
int Option
printf("題目二:河內塔問題\n")
printf("請輸入要搬移的圓盤數目\n")
scanf("%d",&n)
printf("最少搬移的次數為%d次\n",fun_a(n))
printf("是否顯示移動過程? 是請輸入1,否則輸入0\n")
scanf("%d",&Option)
if(Option==1)
{
fun_b(n,1,2,3)
}
system("pause")
return 0
}
int fun_a(int n)
{
int sum1=2,sum2=0,i
for(i=n i>1 i--)
{
sum1=sum1*2
}
sum2=sum1-1
return sum2
}
void fun_b(int n,int left,int mid,int right)
{
if(n==1)
printf("把第%d個盤子從第%d座塔移動到第%d座塔\n",n,left,right)
else
{
fun_b(n-1,left,right,mid)
printf("把第%d個盤子從第%d座塔移動到第%d座塔\n",n,left,right)
fun_b(n-1,mid,left,right)
}
}
標簽:
int
include
stdlib
fun_a
上傳時間:
2016-12-08
上傳用戶:努力努力再努力