discrete-space

Matlab's slice() function not working as desired

梦想与她 提交于 2020-01-13 05:39:06
问题 I want to plot discrete 2D images at 13 z locations at [4:4:52] using the following lines of code. a=100; [mesh.x,mesh.y,mesh.z] = meshgrid(1:1:100,1:1:100,4:4:52); a_unifdist=0; b_unifdist=10; noise=a_unifdist+(b_unifdist-a_unifdist).*rand(100,100,13); c = (a./mesh.x)+noise; slice(c,1:100,1:100,4:4:52); However, I get 13 continuous plots from 1 till 13 instead of 13 discrete locations as shown below: Could somebody tell me what's my mistake? I want the images to stack at [4:4:52] locations

Matlab's slice() function not working as desired

流过昼夜 提交于 2019-12-04 11:46:01
I want to plot discrete 2D images at 13 z locations at [4:4:52] using the following lines of code. a=100; [mesh.x,mesh.y,mesh.z] = meshgrid(1:1:100,1:1:100,4:4:52); a_unifdist=0; b_unifdist=10; noise=a_unifdist+(b_unifdist-a_unifdist).*rand(100,100,13); c = (a./mesh.x)+noise; slice(c,1:100,1:100,4:4:52); However, I get 13 continuous plots from 1 till 13 instead of 13 discrete locations as shown below: Could somebody tell me what's my mistake? I want the images to stack at [4:4:52] locations on z-axis. Thanks. Perhaps you meant: slice(mesh.x, mesh.y, mesh.z, c, [], [], 4:4:52) Here is a more

Determining probability mass function of random variable

自古美人都是妖i 提交于 2019-12-01 03:38:09
问题 If we have a discrete random variable x and the data pertaining to it in X(n), how in matlab can we determine the probability mass function pmf(X)? 回答1: You can do this in at least eight different ways (some of them were already mentioned in the other solutions). Say we have a sample from a discrete random variable: X = randi([-9 9], [100 1]); Consider these equivalent solutions (note that I don't assume anything about the range of possible values, just that they are integers): [V,~,labels] =