小编500*_*500的帖子

Mathematica中的条件列表值替换

请考虑 :

dalist = Transpose@{{"Noise1",1,1,1,1,1},{"Blah", 1, 2, 3, 4, 5},
                   {"Noise2",2,2,2,2,2}, {"COGCondition", 1, 2, 1, 2, 1}}
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

COGCondition1 = 10
COGCondition2 = 20
Run Code Online (Sandbox Code Playgroud)

给定"COGCondition"栏中的值,我想替换"Blah"列中的值,这样:

如果对于给定的行,"COGCondition"列中的值= 1,则"Blah"列中的值应等于COGCondition1(和2 - > COGCondition2)

期望的输出:

在此输入图像描述

我需要这个用于大型数据集并且我尝试使用Table并且Switch失败了.我可以轻松生成新列,但无法弄清楚如何使用替换值Switch.

conditional replace wolfram-mathematica

2
推荐指数
2
解决办法
2271
查看次数

我可以在Mac上使用Kinect吗?

学习愿景,我想玩微软Kinect.

我可以在Mac上使用它吗?

我还没有找到任何适用于Mac的Library,并担心我的笔记本电脑上的虚拟化会使用Linux.

kinect

2
推荐指数
1
解决办法
4216
查看次数

Mathematica中的递归函数

考虑:

dist = Parallelize[
   Table[RandomVariate[NormalDistribution[]], {100000}]];
Run Code Online (Sandbox Code Playgroud)

我怎么能创建一个递归函数,以便:

Subscript[d, 1] = dist[[1]]

Subscript[d, 2] = .95 Subscript[d, 1] + dist[[2]]

Subscript[d, 3] = .95 Subscript[d, 2] + dist[[3]]
Run Code Online (Sandbox Code Playgroud)

直到做到这一点 Subscript[d, 100000]

谢谢.

令人惊讶的是,我第一次碰到这个.

recursion wolfram-mathematica function

2
推荐指数
1
解决办法
532
查看次数

从Mathematica到Matlab输出坐标列表的最佳格式是什么?

我很幸运能够长期避免使用Matlab.但是我需要为我的同事导出这样一个列表,它是384个列表中的8个磁盘坐标和半径.

什么类型的导出格式可以方便她从Matlab中提取这些内容?

在此输入图像描述

wolfram-mathematica export coordinates

2
推荐指数
1
解决办法
764
查看次数

在Mathematica中将对齐添加到Manipulate输出

考虑以下因素:

Manipulate[
           If[Intersection[Row1, Row2] == {}, 
              Style[Plus @@ {Plus @@ Row1, Plus @@ Row2}, Bold, 20],
              "Error"],
{{Row1, {1}}, {1, 2, 3, 4, 5}, ControlType -> TogglerBar},
{{Row2, {2}}, {1, 2, 3, 4, 5}, ControlType -> TogglerBar}
           ]
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

- 我希望"3"能够居中,是否可能?

coding-style wolfram-mathematica alignment

1
推荐指数
1
解决办法
194
查看次数

使用Mathematica中BarChart中的LabelingFunction调整字体

考虑以下BarChart:

如何调整标签功能的字体以及图表标签?

我试过嵌套Style.Unsuccessfull.

BarChart[{1, 2, 3, 4},
ChartStyle -> {Blue, Red, Green, Yellow},
LabelStyle -> Directive[Black, Large],
ChartLabels -> {"COG1", "COG2", "COG3", "COG4"},
ImageSize -> {500, 300},
ChartBaseStyle -> EdgeForm[Thick],
LabelingFunction -> Bottom,
Background -> Black,
LabelStyle -> Directive[Black, Large]]
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

plot wolfram-mathematica bar-chart

1
推荐指数
1
解决办法
589
查看次数

Mathematica中ChartLabel的地图样式

ChartLabels -> Placed[{{Style["0", Bold, 18, FontFamily -> "Helvetica"]},
                       {Style["1", Bold, 18, FontFamily -> "Helvetica"]},
                       {Style["2", Bold, 18, FontFamily -> "Helvetica"]},
                       {Style["3", Bold, 18, FontFamily -> "Helvetica"]},
                       {Style["4", Bold, 18, 
                       FontFamily -> "Helvetica"]}}, 
                       {{.1, .15}, {.3, .15}, {.5, .15}, {.7, .15},{.9, .15}}]
Run Code Online (Sandbox Code Playgroud)

首先,我很抱歉这对我自己来说甚至是一种尴尬,但我无法弄清楚如何在那里使用一个功能.

我怎么能让这更紧?

我尝试嵌套Switch失败了.

coding-style wolfram-mathematica map

1
推荐指数
1
解决办法
223
查看次数

在Mathematica中的ListPlot中指定点样式

考虑到

dacount = {{0, 69}, {1, 122}, {2, 98}, {3, 122}, {4, 69}}

ListPlot[dacount, AxesOrigin -> {-1, 0}, 
         PlotMarkers ->Automatic
         PlotStyle-> Lighter[Red, #] & /@ Range[0.5, 1, 0.1],
         Filling -> Axis, FillingStyle -> Opacity[0.8], 
         PlotRange -> {{-1, 4.5}, {0, 192}}]
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

我希望每一点都能采取不同的红色.但是我不明白如何设置一个样式,我试图设置为不同的列表.

plot wolfram-mathematica point

1
推荐指数
1
解决办法
1783
查看次数

在Mathematica中自定义错误栏图

请考虑 :

Needs["ErrorBarPlots`"];

list = {{223, 231, 167, 245, 292}, {90, 81, 88, 84, 106}}
Run Code Online (Sandbox Code Playgroud)

其中第二个列表代表StandardDeviation

 ErrorListPlot[list // Transpose,                   
               PlotRange -> {{0, 6}, {0, 500}}]
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

我发现很难定制那些ErrorList Plot.所以我的丑陋尝试避免使用包并实现我想要的填充:

ListPlot[{(list[[1]] - list[[2]]), (list[[1]] +
           list[[2]]), list[[1]]}, Filling -> {1 -> {2}}, Joined -> True]
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

问题:

是否有一种"有效"的方法来使用ErrorListPlot调整外观?如果不是,您如何建议使用ListPlot或BarChart处理错误栏?

我必须提到我使用Joined以增加可见性但是,每个点代表不同的主题所以它们不应该是:使用ErrorListPlot我无法使平均值足够可见:-(

编辑:@Sjoerd

在此输入图像描述

plot wolfram-mathematica

1
推荐指数
1
解决办法
6563
查看次数

目标寻求,在Mathematica

对于实验,我们在Matlab中生成了一些由8个磁盘制成的图像.我们限制了磁盘之间以及磁盘和框架之间的最小距离以及磁盘重心(COG)的位置.贝娄在上部升降机"COG"上用COG组成的一个例子

FraXYs = {{4.32, 3.23}, {35.68, 26.75}}

stiDisks = {{{8, 11}, 1}, {{10, 17}, 1}, {{16, 24}, 1}, {{25, 22},1}, 
           {{31, 22}, 1}, {{7, 21}, 2}, {{16, 12}, 2}, {{19, 22}, 2}}

Graphics[{White, EdgeForm[Thick],
  Rectangle @@ FraXYs,
  Red, Disk[{14.77, 18.91}, 1],
  Blue, Opacity[.6], EdgeForm[Black],
  Blue, Thickness[0.003],
  Opacity[1],
  Black,
  Disk[#[[1]], #[[2]]] & /@ stiDisks}, ImageSize -> {400, 300}]
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

我想在Mathematica中产生这些刺激.以下是我正在处理的元素(特征和约束).措施以厘米为单位.形状的重心(COG)定义为磁盘位置的区域.

特点 :

刺激框架: {{xMin,xMin},{xMax,yMax}}

FraXYs = {{4.32, 3.23}, {35.68, 26.75}}
Run Code Online (Sandbox Code Playgroud)

5个小圆盘:半径

rSmall=1
Run Code Online (Sandbox Code Playgroud)

3个大圆盘:半径

rLarge=2
Run Code Online (Sandbox Code Playgroud)

制约因素:

形状边缘之间的最小距离:

minDistSha=1
Run Code Online (Sandbox Code Playgroud)

形状边缘和框架边框之间的最小距离:

minDistFra=1
Run Code Online (Sandbox Code Playgroud)

形状COG距离中心的距离: …

wolfram-mathematica mathematica-8

1
推荐指数
1
解决办法
440
查看次数

在Mathematica中创建一个"视觉噪声矩阵"

为了避免在呈现刺激后出现"视网膜持续性",我需要创建一个视觉噪声掩模.

在此输入图像描述

这适用于具有尺寸的屏幕,像素为:1280*960

我相信我可以随机(统一)为像素分配灰色阴影,但我的尝试却失败了.

感谢您的关注.

wolfram-mathematica mask noise

1
推荐指数
2
解决办法
758
查看次数

Mathematica中磁盘像素的协方差矩阵

我想计算下面图像的协方差矩阵.基于像素.这是将磁盘的每个黑像素视为向量.

虽然下面的单位是厘米,但我使用的屏幕上每厘米有32个像素.

在协方差矩阵计算本身之前,我无法弄清楚获得所有像素矢量的方法.

在此输入图像描述

frmXY = {{6.59, 1.59}, {33.41, 28.41}};

stim = {{10.85, 21.91, 0.97}, {16.8, 5.26, 0.97}, {11.78, 7.11, 0.97}, 
        {12.64, 14.13, 0.97`}, {20.24, 16.16, 0.97}, {29.51, 8.06,1.53}, 
        {22.42, 5.78, 1.53}, {27.13, 16.47, 1.53}}


Graphics[{EdgeForm[Thick],White, Rectangle @@ frmXY, Black,
          Disk @@@ (stim /. {a_, b_, c_} :> {{a, b}, c})}, ImageSize -> 300]
Run Code Online (Sandbox Code Playgroud)

wolfram-mathematica image matrix covariance

1
推荐指数
1
解决办法
812
查看次数

在Mathematica的情节中对背景进行调查

考虑:

ListPlot[Range[10], 
         Background -> Gray, 
         PlotLabel -> "I don`t want the background here !"]
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

有没有办法让背景仅适用于实际的绘图区?

不在轴上,不在标签后面.那么基本上就是那个矩形{{0,0},{10,10}}?

编辑:我们可以使用PolarListPlot做同样的事情吗?

使用Mathematica在笛卡尔图上使用Sjoerd解决方案 到极坐标直方图:

dalist = {{21, 22}, {26, 13}, {32, 17}, {31, 11}, {30, 9}, 
          {25,12}, {12, 16}, {18, 20}, {13, 23}, {19, 21}, 
          {14, 16}, {14,22}, {18, 22}, {10, 22}, {17, 23}}

ScreenCenter = {20, 15}

ListPolarPlot[{ArcTan[##],EuclideanDistance[##]} & @@@ (# - ScreenCenter & /@ dalist), 
               PolarAxes -> True, PolarGridLines -> Automatic, Joined -> False, 
               PolarTicks -> {"Degrees", Automatic}, 
               BaseStyle -> …
Run Code Online (Sandbox Code Playgroud)

customization plot background wolfram-mathematica

0
推荐指数
2
解决办法
1489
查看次数