# include<stdio.h> # include<math.h> # define N 3 main(){ float NF2(float *x,float *y); float A[N][N]={{10,-1,-2},{-1,10,-2},{-1,-1,5}}; float b[N]={7.2,8.3,4.2},sum=0; float x[N]= {0,0,0},y[N]={0},x0[N]={}; int i,j,n=0; for(i=0;i<N;i++) { x[i]=x0[i]; } for(n=0;;n++){ //計(jì)算下一個(gè)值 for(i=0;i<N;i++){ sum=0; for(j=0;j<N;j++){ if(j!=i){ sum=sum+A[i][j]*x[j]; } } y[i]=(1/A[i][i])*(b[i]-sum); //sum=0; } //判斷誤差大小 if(NF2(x,y)>0.01){ for(i=0;i<N;i++){ x[i]=y[i]; } } else break; } printf("經(jīng)過%d次雅可比迭代解出方程組的解:\n",n+1); for(i=0;i<N;i++){ printf("%f ",y[i]); } } //求兩個(gè)向量差的二范數(shù)函數(shù) float NF2(float *x,float *y){ int i; float z,sum1=0; for(i=0;i<N;i++){ sum1=sum1+pow(y[i]-x[i],2); } z=sqrt(sum1); return z; }
上傳時(shí)間: 2019-10-13
上傳用戶:大萌萌撒
function [R,k,b] = msc(A) % 多元散射校正 % 輸入待處理矩陣,通過多元散射校正,求得校正后的矩陣 %% 獲得矩陣行列數(shù) [m,n] = size(A); %% 求平均光譜 M = mean(A,2); %% 利用最小二乘法求每一列的斜率k和截距b for i = 1:n a = polyfit(M,A(:,i),1); if i == 1 k = a(1); b = a(2); else k = [k,a(1)]; b = [b,a(2)]; end end %% 求得結(jié)果 for i = 1:n Ai = (A(:,i)-b(i))/k(i); if i == 1 R = Ai; else R = [R,Ai]; end end
上傳時(shí)間: 2020-03-12
上傳用戶:15275387185
P P I I CK I I T T3 3 使用 說明--- - 連機(jī) 、 脫 機(jī)操作試用 MPLAB IDE 軟件一 、 P P I I C CK K I I T3 接 口說 明, , 硬 件 二 、 P P I I C CK K I I T3 連 接 電腦 MPL L AB I I DE 聯(lián)機(jī)三 、 聯(lián)機(jī)四 、聯(lián)機(jī)讀芯片程序五 、 脫機(jī) 燒寫 調(diào)試
標(biāo)簽: kit3 聯(lián)機(jī) 脫機(jī)
上傳時(shí)間: 2022-03-24
上傳用戶:
本文闡述了用 ASP 技術(shù)結(jié)合ACCESS 2003數(shù)據(jù)庫采用B/S模式設(shè)計(jì)的網(wǎng)上鮮花銷售系統(tǒng)。系統(tǒng)實(shí)現(xiàn)了用戶注冊(cè)、用戶登陸、商品列表、在線購物、查看訂單、修改訂單和后臺(tái)商品管理、訂單管理等功能。 通過這個(gè)網(wǎng)站平臺(tái),一般用戶可以方便地在線瀏覽系統(tǒng)中提供的各種鮮花商品,只有注冊(cè)用戶才可以購買鮮花。注冊(cè)用戶選好所需的鮮花,就可以填寫訂單,等待商家提供送貨業(yè)務(wù)。實(shí)際的商品交割需要到現(xiàn)實(shí)世界中來完成,為了更好地審核顧客的身份及購物定單,對(duì)顧客采取會(huì)員制管理,查證以后才進(jìn)行實(shí)際的商品交割,完成整個(gè)交易過程。
標(biāo)簽: 銷售
上傳時(shí)間: 2013-04-24
上傳用戶:450976175
特點(diǎn): 精確度0.1%滿刻度 可作各式數(shù)學(xué)演算式功能如:A+B/A-B/AxB/A/B/A&B(Hi or Lo)/|A|/ 16 BIT類比輸出功能 輸入與輸出絕緣耐壓2仟伏特/1分鐘(input/output/power) 寬范圍交直流兩用電源設(shè)計(jì) 尺寸小,穩(wěn)定性高
標(biāo)簽: 微電腦 數(shù)學(xué)演算 隔離傳送器
上傳時(shí)間: 2014-12-23
上傳用戶:ydd3625
定點(diǎn)乘法器設(shè)計(jì)(中文) 運(yùn)算符: + 對(duì)其兩邊的數(shù)據(jù)作加法操作; A + B - 從左邊的數(shù)據(jù)中減去右邊的數(shù)據(jù); A - B - 對(duì)跟在其后的數(shù)據(jù)作取補(bǔ)操作,即用0減去跟在其后的數(shù)據(jù); - B * 對(duì)其兩邊的數(shù)據(jù)作乘法操作; A * B & 對(duì)其兩邊的數(shù)據(jù)按位作與操作; A & B # 對(duì)其兩邊的數(shù)據(jù)按位作或操作; A # B @ 對(duì)其兩邊的數(shù)據(jù)按位作異或操作; A @ B ~ 對(duì)跟在其后的數(shù)據(jù)作按位取反操作; ~ B << 以右邊的數(shù)據(jù)為移位量將左邊的數(shù)據(jù)左移; A << B $ 將其兩邊的數(shù)據(jù)按從左至右順序拼接; A $ B
標(biāo)簽: 定點(diǎn) 乘法器設(shè)計(jì)
上傳時(shí)間: 2013-12-17
上傳用戶:trepb001
TLC2543是TI公司的12位串行模數(shù)轉(zhuǎn)換器,使用開關(guān)電容逐次逼近技術(shù)完成A/D轉(zhuǎn)換過程。由于是串行輸入結(jié)構(gòu),能夠節(jié)省51系列單片機(jī)I/O資源;且價(jià)格適中,分辨率較高,因此在儀器儀表中有較為廣泛的應(yīng)用。 TLC2543的特點(diǎn) (1)12位分辯率A/D轉(zhuǎn)換器; (2)在工作溫度范圍內(nèi)10μs轉(zhuǎn)換時(shí)間; (3)11個(gè)模擬輸入通道; (4)3路內(nèi)置自測(cè)試方式; (5)采樣率為66kbps; (6)線性誤差±1LSBmax; (7)有轉(zhuǎn)換結(jié)束輸出EOC; (8)具有單、雙極性輸出; (9)可編程的MSB或LSB前導(dǎo); (10)可編程輸出數(shù)據(jù)長度。 TLC2543的引腳排列及說明 TLC2543有兩種封裝形式:DB、DW或N封裝以及FN封裝,這兩種封裝的引腳排列如圖1,引腳說明見表1 TLC2543電路圖和程序欣賞 #include<reg52.h> #include<intrins.h> #define uchar unsigned char #define uint unsigned int sbit clock=P1^0; sbit d_in=P1^1; sbit d_out=P1^2; sbit _cs=P1^3; uchar a1,b1,c1,d1; float sum,sum1; double sum_final1; double sum_final; uchar duan[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f}; uchar wei[]={0xf7,0xfb,0xfd,0xfe}; void delay(unsigned char b) //50us { unsigned char a; for(;b>0;b--) for(a=22;a>0;a--); } void display(uchar a,uchar b,uchar c,uchar d) { P0=duan[a]|0x80; P2=wei[0]; delay(5); P2=0xff; P0=duan[b]; P2=wei[1]; delay(5); P2=0xff; P0=duan[c]; P2=wei[2]; delay(5); P2=0xff; P0=duan[d]; P2=wei[3]; delay(5); P2=0xff; } uint read(uchar port) { uchar i,al=0,ah=0; unsigned long ad; clock=0; _cs=0; port<<=4; for(i=0;i<4;i++) { d_in=port&0x80; clock=1; clock=0; port<<=1; } d_in=0; for(i=0;i<8;i++) { clock=1; clock=0; } _cs=1; delay(5); _cs=0; for(i=0;i<4;i++) { clock=1; ah<<=1; if(d_out)ah|=0x01; clock=0; } for(i=0;i<8;i++) { clock=1; al<<=1; if(d_out) al|=0x01; clock=0; } _cs=1; ad=(uint)ah; ad<<=8; ad|=al; return(ad); } void main() { uchar j; sum=0;sum1=0; sum_final=0; sum_final1=0; while(1) { for(j=0;j<128;j++) { sum1+=read(1); display(a1,b1,c1,d1); } sum=sum1/128; sum1=0; sum_final1=(sum/4095)*5; sum_final=sum_final1*1000; a1=(int)sum_final/1000; b1=(int)sum_final%1000/100; c1=(int)sum_final%1000%100/10; d1=(int)sum_final%10; display(a1,b1,c1,d1); } }
上傳時(shí)間: 2013-11-19
上傳用戶:shen1230
RSA算法 :首先, 找出三個(gè)數(shù), p, q, r, 其中 p, q 是兩個(gè)相異的質(zhì)數(shù), r 是與 (p-1)(q-1) 互質(zhì)的數(shù)...... p, q, r 這三個(gè)數(shù)便是 person_key,接著, 找出 m, 使得 r^m == 1 mod (p-1)(q-1)..... 這個(gè) m 一定存在, 因?yàn)?r 與 (p-1)(q-1) 互質(zhì), 用輾轉(zhuǎn)相除法就可以得到了..... 再來, 計(jì)算 n = pq....... m, n 這兩個(gè)數(shù)便是 public_key ,編碼過程是, 若資料為 a, 將其看成是一個(gè)大整數(shù), 假設(shè) a < n.... 如果 a >= n 的話, 就將 a 表成 s 進(jìn)位 (s
標(biāo)簽: person_key RSA 算法
上傳時(shí)間: 2013-12-14
上傳用戶:zhuyibin
大整數(shù)乘法例子代碼 /* 遞歸邊界,如果是1位二進(jìn)制數(shù)與1位二進(jìn)制數(shù)相乘,則可以直接計(jì)算 */ /*累計(jì)做1位二進(jìn)制乘法運(yùn)算的次數(shù)*/ /* return (X*Y) */ /* 計(jì)算n的值 */ /* 把X和Y拆分開來,令X=A*2^(n/2)+B, 左移位運(yùn)算,mod = 1<<(n/2) */ /* 計(jì)算XY=AC*2^n+(AD+CB)*2^(n/2)+BD */ /* 計(jì)算A*C,再向左移n位 */ /* 遞歸計(jì)算A*D */ /* 遞歸計(jì)算C*B */ /* 計(jì)算a21+a22,再向左移n/2位 */ /* 遞歸計(jì)算B*D */ /* XY=a1+a2+a3 */
上傳時(shí)間: 2015-05-19
上傳用戶:gyq
The government of a small but important country has decided that the alphabet needs to be streamlined and reordered. Uppercase letters will be eliminated. They will issue a royal decree in the form of a String of B and A characters. The first character in the decree specifies whether a must come ( B )Before b in the new alphabet or ( A )After b . The second character determines the relative placement of b and c , etc. So, for example, "BAA" means that a must come Before b , b must come After c , and c must come After d . Any letters beyond these requirements are to be excluded, so if the decree specifies k comparisons then the new alphabet will contain the first k+1 lowercase letters of the current alphabet. Create a class Alphabet that contains the method choices that takes the decree as input and returns the number of possible new alphabets that conform to the decree. If more than 1,000,000,000 are possible, return -1. Definition
標(biāo)簽: government streamline important alphabet
上傳時(shí)間: 2015-06-09
上傳用戶:weixiao99
蟲蟲下載站版權(quán)所有 京ICP備2021023401號(hào)-1