乡下人产国偷v产偷v自拍,国产午夜片在线观看,婷婷成人亚洲综合国产麻豆,久久综合给合久久狠狠狠9

  • <output id="e9wm2"></output>
    <s id="e9wm2"><nobr id="e9wm2"><ins id="e9wm2"></ins></nobr></s>

    • 分享

      多值高斯分布matlab繪制

       無名小卒917 2015-01-06

      問題

      I have a bivariate gaussian I defined as follow:

      I=[1 0;0 1];
      mu=[0,0];
      sigma=0.5*I;
      beta = mvnrnd(mu,sigma,100);  %100x2 matrix where each column vector is a variable.

      now I want to plot a contour of the pdf of the above matrix. What I did:

      Z = mvnpdf(beta,mu,sigma);  %100x1 pdf matrix

      Now I want to plot a contour of the bivariate gaussian beta. I know I should use the command contour but this one require Z to be a square matrix. how do I solve this? I am very confused and not sure how to plot the contour of the bivariate gaussian!! ANY HELP IS GREATLY APPRECIATED..

      Thank you

      解答:

      You need to define your x, y axes and use meshgrid (or ndgrid) to generate all combinations of x, y values, in the form of two matrices X and Y. You then compute the Z values (your Gaussian pdf) for those X and Y, and plot Z as a function of X , Y using contour (contour plot), or perhaps surf (3D plot).

      mu = [0,0]; %// data
      sigma = [.5 0; 0 .5]; %// data
      x = -5:.1:5; %// x axis
      y = -4:.1:4; %// y axis
      
      [X Y] = meshgrid(x,y); %// all combinations of x, y
      Z = mvnpdf([X(:) Y(:)],mu,sigma); %// compute Gaussian pdf
      Z = reshape(Z,size(X)); %// put into same size as X, Y
      %// contour(X,Y,Z), axis equal  %// contour plot; set same scale for x and y...
      surf(X,Y,Z) %// ... or 3D plot
      多值高斯分布matlab繪制 - 飛劍蕭林 - 飛劍蕭林 — 中國

        多值高斯分布matlab繪制 - 飛劍蕭林 - 飛劍蕭林 — 中國

      轉(zhuǎn)自:http:///questions/20170083/plot-a-contour-of-multivariate-normal-pdf-of-a-given-mvn-in-matlab

       

        本站是提供個人知識管理的網(wǎng)絡(luò)存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊一鍵舉報。
        轉(zhuǎn)藏 分享 獻(xiàn)花(0

        0條評論

        發(fā)表

        請遵守用戶 評論公約

        類似文章 更多