亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

蟲(chóng)蟲(chóng)首頁(yè)| 資源下載| 資源專輯| 精品軟件
登錄| 注冊(cè)

點(diǎn)(diǎn)對(duì)(duì)點(diǎn)(diǎn)網(wǎng)(wǎng)絡(luò)(luò)

  • 尋找中位數(shù)

    已知一個(gè)整數(shù)序列A=(a0,a1,…,an-1),其中0≤ai<n(0≤i<n)。若存在ap1=ap2=…=apm=x且m>n/2(0≤pk<n,1≤k≤m),則稱x為A的主元素。例如A= ( 0,5,5,3,5,7,5,5 ),則5為主元素;又如A= ( 0,5,5,3,5,1,5,7 ),則A中沒(méi)有主元素。 假設(shè)A中的n個(gè)元素保存在一個(gè)一維數(shù)組中,請(qǐng)?jiān)O(shè)計(jì)一個(gè)盡可能高效的算法,找出A的主元素。若存在主元素,則輸出該元素;否則輸出-1。

    標(biāo)簽: 元素 ap1 ap2 apm an 整數(shù) 序列

    上傳時(shí)間: 2020-03-04

    上傳用戶:霖1234

  • matlab神經(jīng)網(wǎng)絡(luò)算法通信信號(hào)調(diào)制識(shí)別

    %========================開(kāi)始提取加噪信號(hào)的各類特征值================================ for n=1:1:50;     m=n*Ns;     x=(n-1)*Ns; for i=x+1:m;          %提取加噪信號(hào)'signal_with_noise=y+noise'的前256個(gè)元素,抽取50次     y0(i)=signal_with_noise(i); end Y=fft(y0);        %對(duì)調(diào)制信號(hào)進(jìn)行快速傅里葉算法(離散) y1=hilbert(y0) ;    %調(diào)制信號(hào)實(shí)部的解析式  factor=0;        %開(kāi)始求零中心歸一化瞬時(shí)幅度譜密度的最大值gamma_max for i=x+1:m;    factor=factor+y0(i); end ms=factor/(m-x); an_i=y0./ms; acn_i=an_i-1; end gamma_max=max(fft(acn_i.*acn_i))/Ns

    標(biāo)簽: matlab 神經(jīng)網(wǎng)絡(luò)算法 通信信號(hào) 調(diào)制識(shí)別

    上傳時(shí)間: 2020-04-07

    上傳用戶:如拷貝般復(fù)制

  • matlab神經(jīng)網(wǎng)絡(luò)算法通信信號(hào)調(diào)制識(shí)別y

    %========================開(kāi)始提取加噪信號(hào)的各類特征值================================ for n=1:1:50;     m=n*Ns;     x=(n-1)*Ns; for i=x+1:m;          %提取加噪信號(hào)'signal_with_noise=y+noise'的前256個(gè)元素,抽取50次     y0(i)=signal_with_noise(i); end Y=fft(y0);        %對(duì)調(diào)制信號(hào)進(jìn)行快速傅里葉算法(離散) y1=hilbert(y0) ;    %調(diào)制信號(hào)實(shí)部的解析式  factor=0;        %開(kāi)始求零中心歸一化瞬時(shí)幅度譜密度的最大值gamma_max for i=x+1:m;    factor=factor+y0(i); end ms=factor/(m-x); an_i=y0./ms; acn_i=an_i-1; end gamma_max=max(fft(acn_i.*acn_i))/Ns

    標(biāo)簽: matlab 神經(jīng)網(wǎng)絡(luò)算法 通信信號(hào) 調(diào)制識(shí)別

    上傳時(shí)間: 2020-04-07

    上傳用戶:如拷貝般復(fù)制

  • 二叉樹(shù)子系統(tǒng)

    #include<stdio.h> #define TREEMAX 100 typedef struct  BT { char data; BT *lchild; BT *rchild; }BT; BT *CreateTree(); void Preorder(BT *T); void Postorder(BT *T); void Inorder(BT *T); void Leafnum(BT *T); void Nodenum(BT *T); int TreeDepth(BT *T); int count=0; void main() { BT *T=NULL; char ch1,ch2,a; ch1='y'; while(ch1=='y'||ch1=='y') { printf("\n"); printf("\n\t\t             二叉樹(shù)子系統(tǒng)"); printf("\n\t\t*****************************************"); printf("\n\t\t           1---------建二叉樹(shù)            "); printf("\n\t\t           2---------先序遍歷            "); printf("\n\t\t           3---------中序遍歷            "); printf("\n\t\t           4---------后序遍歷            "); printf("\n\t\t           5---------求葉子數(shù)            "); printf("\n\t\t           6---------求結(jié)點(diǎn)數(shù)            "); printf("\n\t\t           7---------求樹(shù)深度            "); printf("\n\t\t           0---------返    回            "); printf("\n\t\t*****************************************"); printf("\n\t\t      請(qǐng)選擇菜單號(hào) (0--7)"); scanf("%c",&ch2); getchar(); printf("\n"); switch(ch2) { case'1': printf("\n\t\t請(qǐng)按先序序列輸入二叉樹(shù)的結(jié)點(diǎn):\n"); printf("\n\t\t說(shuō)明:輸入結(jié)點(diǎn)(‘0’代表后繼結(jié)點(diǎn)為空)后按回車。\n"); printf("\n\t\t請(qǐng)輸入根結(jié)點(diǎn):"); T=CreateTree(); printf("\n\t\t二叉樹(shù)成功建立!\n");break; case'2': printf("\n\t\t該二叉樹(shù)的先序遍歷序列為:"); Preorder(T);break; case'3': printf("\n\t\t該二叉樹(shù)的中序遍歷序列為:"); Inorder(T);break; case'4': printf("\n\t\t該二叉樹(shù)的后序遍歷序列為:"); Postorder(T);break; case'5': count=0;Leafnum(T); printf("\n\t\t該二叉樹(shù)有%d個(gè)葉子。\n",count);break; case'6': count=0;Nodenum(T); printf("\n\t\t該二叉樹(shù)總共有%d個(gè)結(jié)點(diǎn)。\n",count);break; case'7': printf("\n\t\t該樹(shù)的深度為:%d",TreeDepth(T)); break; case'0': ch1='n';break; default: printf("\n\t\t***請(qǐng)注意:輸入有誤!***"); } if(ch2!='0') { printf("\n\n\t\t按【Enter】鍵繼續(xù),按任意鍵返回主菜單!\n"); a=getchar(); if(a!='\xA') { getchar(); ch1='n'; } } } } BT *CreateTree() { BT *t; char x; scanf("%c",&x); getchar(); if(x=='0') t=NULL; else { t=new BT; t->data=x; printf("\n\t\t請(qǐng)輸入%c結(jié)點(diǎn)的左子結(jié)點(diǎn):",t->data);         t->lchild=CreateTree(); printf("\n\t\t請(qǐng)輸入%c結(jié)點(diǎn)的右子結(jié)點(diǎn):",t->data);         t->rchild=CreateTree();     } return t; } void Preorder(BT *T) { if(T) { printf("%3c",T->data); Preorder(T->lchild); Preorder(T->rchild); } } void Inorder(BT *T) { if(T) { Inorder(T->lchild); printf("%3c",T->data); Inorder(T->rchild); } } void Postorder(BT *T) { if(T) { Postorder(T->lchild); Postorder(T->rchild); printf("%3c",T->data); } } void Leafnum(BT *T) { if(T) { if(T->lchild==NULL&&T->rchild==NULL) count++; Leafnum(T->lchild); Leafnum(T->rchild); } } void Nodenum(BT *T) { if(T) { count++; Nodenum(T->lchild); Nodenum(T->rchild); } } int TreeDepth(BT *T) { int ldep,rdep; if(T==NULL) return 0; else { ldep=TreeDepth(T->lchild); rdep=TreeDepth(T->rchild); if(ldep>rdep) return ldep+1; else return rdep+1; } }

    標(biāo)簽: 二叉樹(shù) 子系統(tǒng)

    上傳時(shí)間: 2020-06-11

    上傳用戶:ccccy

  • 數(shù)組子系統(tǒng)

    #include <stdio.h> #include <stdlib.h> #define SMAX 100 typedef struct SPNode { int i,j,v; }SPNode; struct sparmatrix { int rows,cols,terms; SPNode data [SMAX]; }; sparmatrix CreateSparmatrix() { sparmatrix A; printf("\n\t\t請(qǐng)輸入稀疏矩陣的行數(shù),列數(shù)和非零元素個(gè)數(shù)(用逗號(hào)隔開(kāi)):"); scanf("%d,%d,%d",&A.cols,&A.terms); for(int n=0;n<=A.terms-1;n++) { printf("\n\t\t輸入非零元素值(格式:行號(hào),列號(hào),值):"); scanf("%d,%d,%d",&A.data[n].i,&A.data[n].j,&A.data[n].v); } return A; } void ShowSparmatrix(sparmatrix A) { int k; printf("\n\t\t"); for(int x=0;x<=A.rows-1;x++) { for(int y=0;y<=A.cols-1;y++) { k=0; for(int n=0;n<=A.terms-1;n++) { if((A.data[n].i-1==x)&&(A.data[n].j-1==y)) { printf("%8d",A.data[n].v); k=1; } } if(k==0) printf("%8d",k); } printf("\n\t\t"); } } void sumsparmatrix(sparmatrix A) { SPNode *p; p=(SPNode*)malloc(sizeof(SPNode)); p->v=0; int k; k=0; printf("\n\t\t"); for(int x=0;x<=A.rows-1;x++) { for(int y=0;y<=A.cols-1;y++) { for(int n=0;n<=A.terms;n++) { if((A.data[n].i==x)&&(A.data[n].j==y)&&(x==y)) { p->v=p->v+A.data[n].v; k=1; } } } printf("\n\t\t"); } if(k==1) printf("\n\t\t對(duì)角線元素的和::%d\n",p->v); else printf("\n\t\t對(duì)角線元素的和為::0"); } int main() { int ch=1,choice; struct sparmatrix A; A.terms=0; while(ch) { printf("\n"); printf("\n\t\t      稀疏矩陣的三元組系統(tǒng)       "); printf("\n\t\t*********************************"); printf("\n\t\t      1------------創(chuàng)建          "); printf("\n\t\t      2------------顯示          "); printf("\n\t\t      3------------求對(duì)角線元素和"); printf("\n\t\t      4------------返回          "); printf("\n\t\t*********************************"); printf("\n\t\t請(qǐng)選擇菜單號(hào)(0-3):"); scanf("%d",&choice); switch(choice) { case 1: A=CreateSparmatrix(); break; case 2: ShowSparmatrix(A); break; case 3: SumSparmatrix(A); break; default: system("cls"); printf("\n\t\t輸入錯(cuò)誤!請(qǐng)重新輸入!\n"); break; } if (choice==1||choice==2||choice==3) { printf("\n\t\t"); system("pause"); system("cls"); } else system("cls"); } }

    標(biāo)簽: 數(shù)組 子系統(tǒng)

    上傳時(shí)間: 2020-06-11

    上傳用戶:ccccy

  • 復(fù)活節(jié)計(jì)算器

    復(fù)活節(jié)計(jì)算 int y, n, a, q, b, m, w, d, mm = 4; y = atoi(argv[1]); n = y-1900;  a = fmod(n,19); 

    標(biāo)簽: 計(jì)算器 C語(yǔ)言

    上傳時(shí)間: 2021-07-09

    上傳用戶:scfan2004

  • CAZAC序列MATLAB實(shí)現(xiàn)

    Chu序列、Bjork序列、P序列實(shí)現(xiàn) %   cazac_creat 生成cazac序列 %   signal_length:生成cazac信號(hào)長(zhǎng)度 N %   cazac_seq:生成的cazac序列 %   sig_num:序列個(gè)數(shù)  M %   k=signal_length-1; %   seq_switch: %   1:Chu M<=N-1 %   2:P M<=N %   3:Bjorck M<=N

    標(biāo)簽: MATLAB CAZAC 序列

    上傳時(shí)間: 2021-11-11

    上傳用戶:BY1902082

  • arduino電子秤程序

    HX711_1Kg#include "HX711.h"float Weight = 0;void setup(){ Init_Hx711(); //初始化HX711模塊連接的IO設(shè)置 Serial.begin(9600); Serial.print("Welcome to use!\n"); delay(3000); Get_Maopi(); //獲取毛皮}void loop(){ Weight = Get_Weight(); //計(jì)算放在傳感器上的重物重量 Serial.print(float(Weight/1000),3); //串口顯示重量 Serial.print(" kg\n"); //顯示單位 Serial.print("\n"); //顯示單位 delay(1000); //延時(shí)1s}

    標(biāo)簽: arduino 電子秤

    上傳時(shí)間: 2022-03-20

    上傳用戶:

  • STM32F103開(kāi)發(fā)板 DHT11溫濕度DS18B20 氣體MQ-2光敏聲控雨滴傳感器實(shí)驗(yàn)程序

    STM32F103開(kāi)發(fā)板 DHT11溫濕度DS18B20 氣體MQ-2光敏聲控雨滴傳感器實(shí)驗(yàn)程序**--------------------------------------------------------------------------------------------------------** Created by: FiYu** Created date: 2015-12-12** Version:     1.0** Descriptions: DHT11溫濕度傳感器實(shí)驗(yàn) **--------------------------------------------------------------------------------------------------------** Modified by: FiYu** Modified date: ** Version: ** Descriptions: ** Rechecked by: **********************************************************************************************************/#include "stm32f10x.h"#include "delay.h"#include "dht11.h"#include "usart.h"DHT11_Data_TypeDef DHT11_Data;/************************************************************************************** * 描  述 : GPIO/USART1初始化配置 * 入  參 : 無(wú) * 返回值 : 無(wú) **************************************************************************************/void GPIO_Configuration(void){ GPIO_InitTypeDef GPIO_InitStructure; /* Enable the GPIO_LED Clock */ RCC_APB2PeriphClockCmd( RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB | RCC_APB2Periph_AFIO , ENABLE);     GPIO_DeInit(GPIOB); //將外設(shè)GPIOA寄存器重設(shè)為缺省值 GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;    //推挽輸出 GPIO_Init(GPIOB, &GPIO_InitStructure); GPIO_DeInit(GPIOA); //將外設(shè)GPIOA寄存器重設(shè)為缺省值 GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;    //推挽輸出 GPIO_Init(GPIOA, &GPIO_InitStructure); GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;    //浮空輸入 GPIO_Init(GPIOA, &GPIO_InitStructure); GPIO_SetBits(GPIOB , GPIO_Pin_9);   //初始狀態(tài),熄滅指示燈LED1}/************************************************************************************** * 描  述 : 串口顯示實(shí)時(shí)溫濕度 * 入  參 : 無(wú) * 返回值 : 無(wú) **************************************************************************************/void DHT11_SCAN(void){ if( Read_DHT11(&DHT11_Data)==SUCCESS) { printf("\r\n讀取DHT11成功!\r\n\r\n濕度為%d.%d %RH ,溫度為 %d.%d℃ \r\n",\ DHT11_Data.humi_int,DHT11_Data.humi_deci,DHT11_Data.temp_int,DHT11_Data.temp_deci); //printf("\r\n 濕度:%d,溫度:%d \r\n" ,DHT11_Data.humi_int,DHT11_Data.temp_int); } else { printf("Read DHT11 ERROR!\r\n"); }}/************************************************************************************** * 描  述 : MAIN函數(shù) * 入  參 : 無(wú) * 返回值 : 無(wú) **************************************************************************************/int main(void){ SystemInit(); //設(shè)置系統(tǒng)時(shí)鐘72MHZ GPIO_Configuration(); USART1_Init();    //初始化配置TIM DHT11_GPIO_Config();   // 初始化溫濕度傳感器PB1引腳初始時(shí)為推挽輸出 GPIO_ResetBits(GPIOB , GPIO_Pin_9); delay_ms(500);   while(1)  { GPIO_SetBits(GPIOB , GPIO_Pin_9);    DHT11_SCAN();  //實(shí)時(shí)顯示溫濕度 delay_ms(1500); } }

    標(biāo)簽: stm32f103 傳感器

    上傳時(shí)間: 2022-05-03

    上傳用戶:得之我幸78

  • 艾默生 模塊電源的并聯(lián)均流技術(shù)

    艾默生 模塊電源的并聯(lián)均流技術(shù):n一,概述 n二,常用并聯(lián)均流技術(shù) n三,應(yīng)用實(shí)例 n四,注意事項(xiàng)

    標(biāo)簽: 模塊電源 并聯(lián)均流

    上傳時(shí)間: 2022-07-26

    上傳用戶:

主站蜘蛛池模板: 和田市| 清水河县| 新闻| 华蓥市| 广饶县| 灌云县| 逊克县| 温州市| 宁安市| 新野县| 双鸭山市| 耿马| 合阳县| 英超| 广东省| 运城市| 斗六市| 邢台县| 阜城县| 白河县| 上虞市| 恭城| 连江县| 禹州市| 万安县| 玉林市| 鄂尔多斯市| 武义县| 博野县| 金川县| 正阳县| 浪卡子县| 固安县| 全州县| 林州市| 文成县| 锡林浩特市| 五华县| 清涧县| 通城县| 友谊县|