以下代码允许您使用惠斯通电桥中的值。输出显示在滑块右侧。如何使输出面板( expr )出现在其他位置,如何设置固定大小? (我只能找到操作控件大小和位置的选项,而不是Manipulate文档中的输出。)
Manipulate[
Evaluate[(10^Rx/(10^R3 + 10^Rx) - 10^R2/(10^R1 + 10^R2))*Vin] "V",
{{R1, 5}, 1, 6, 0.01},
Pane["R1 = " Dynamic[Round[10^R1] "\[CapitalOmega]"],
ImageMargins -> {{2.5, 0}, {3, 0}}], {{R2, 5}, 1, 6, 0.01},
Pane["R2 = " Dynamic[Round[10^R2] "\[CapitalOmega]"],
ImageMargins -> {{2.5, 0}, {3, 0}}], {{R3, 5}, 1, 6, 0.01},
Pane["R3 = " Dynamic[Round[10^R3] "\[CapitalOmega]"],
ImageMargins -> {{2.5, 0}, {3, 0}}],
{{Rx, 5}, 1, 6, 0.01},
Pane["Rx = " Dynamic[Round[10^Rx] "\[CapitalOmega]"],
ImageMargins -> {{2.5, 0}, {3, 0}}],
{{Vin, 2.5}, 0, VMax, Appearance -> "Open"}]
答案 0 :(得分:5)
好吧,如果您可以根据内容框定位控件,那么您也可以将内容框放在控件上,不是吗?
所以,ControlPlacement
应该处理你的盒子的位置,然后把它放在Pane
中来处理它的大小(ImageSize
,尽管它似乎需要它控制尺寸的最小尺寸。)
VMax = 12;
Manipulate[
Pane[ToString[(10^Rx/(10^R3 + 10^Rx) - 10^R2/(10^R1 + 10^R2))*Vin] <>
"V", ImageSize -> {500, 20}], {{R1, 5}, 1, 6, 0.01},
Pane["R1 = " Dynamic[Round[10^R1] "\[CapitalOmega]"],
ImageMargins -> {{2.5, 0}, {3, 0}}], {{R2, 5}, 1, 6, 0.01},
Pane["R2 = " Dynamic[Round[10^R2] "\[CapitalOmega]"],
ImageMargins -> {{2.5, 0}, {3, 0}}], {{R3, 5}, 1, 6, 0.01},
Pane["R3 = " Dynamic[Round[10^R3] "\[CapitalOmega]"],
ImageMargins -> {{2.5, 0}, {3, 0}}], {{Rx, 5}, 1, 6, 0.01},
Pane["Rx = " Dynamic[Round[10^Rx] "\[CapitalOmega]"],
ImageMargins -> {{2.5, 0}, {3, 0}}], {{Vin, 2.5}, 0, VMax,
Appearance -> "Open"}, ControlPlacement -> Bottom]
编辑将[CapitalOmega]
更改为\[CapitalOmega]
。谢谢Belisarius。
新图片。谢谢向导。