Community RSS Feed
http://community.wolfram.com
RSS Feed for Wolfram Community showing any discussions in tag Mathematica sorted by active2D Hexagon to 3D Hexagon prism, or Thick Hexagon Mesh?
http://community.wolfram.com/groups/-/m/t/1290648
So I tried this code for 2D, but I would like to have say a slab with a defined thickness not just a plane,
The code for 2D is:
h[x_, y_] :=
Polygon[Table[{Cos[2 Pi k/6] + x, Sin[2 Pi k/6] + y}, {k, 6}]];
Graphics[{EdgeForm[Opacity[.7]], LightBlue,
Table[h[3 i + 3 ((-1)^j + 1)/4, Sqrt[3]/2 j], {i, 10}, {j, 15}]}]
I also found and modified this code [Here][1] but this is a very thin sheet , I would like to be able to define a thickness to it:
Graphics3D[
With[{hex =
Polygon[Table[{Cos[2 Pi k/6] + #, Sin[2 Pi k/6] + #2}, {k,
6}]] &},
Table[hex[3 i + 3 ((-1)^j + 1)/4, Sqrt[3]/2 j], {i, 10}, {j,
15}]] /.
Polygon[l_] :> {Red, Polygon[l], Polygon[{1, 0} # & /@ l]} /.
Polygon[l_List] :> Polygon[top @@@ l], Boxed -> False,
Axes -> False, PlotRange -> All, Lighting -> "Neutral"]
Can you help me how to convert 2D hexagonal to 3D hexagonal slab with user defined thickness?
[1]: https://mathematica.stackexchange.com/questions/77312/hexagonal-mesh-on-a-3d-surfaceArm Mo2018-02-24T02:10:32ZLength and Width of a line
http://community.wolfram.com/groups/-/m/t/1291132
Hello,
How do I measure the average length and the average width of a line from an image?
For example, the length and the width of the river in the attached picture.![enter image description here][1]
Thank you
[1]: http://community.wolfram.com//c/portal/getImageAttachment?filename=fsbdev3_066534.jpg&userId=1291117Subbarao Raikar2018-02-23T22:56:12ZDoes anyone run Mathematica on a ODROID-MC1 ?
http://community.wolfram.com/groups/-/m/t/1290909
Hi,
Does anyone run Mathematica under any Linux variant on a ODROID-MC1 ? /https://odroidinc.com/collections/odroid-single-board-computers/products/odroid-mc1-1 /
If yes, was was the WolframMark score ?
Thanks ahead,
JánosJanos Lobb2018-02-23T19:50:43ZMathematica for nuclear medicine?
http://community.wolfram.com/groups/-/m/t/1290721
One of my relatives is a cardiologist, and he uses a ridiculously expensive medical imaging workstation with proprietary software that costs tens of thousands of dollars. This thing is ancient and runs Solaris. It's called a Pegasys ADAC I believe. Here is a sample of what this type of system analyzes:
![Image slices in a nuclear medicine study][1]
These are image slices from a camera that orbits around the patient and looks at their heart. It works by detecting radioactive emissions from isotopes injected into the patient. The proprietary software ([examples of software][2]) assembles these slices into a volumetric visualization of blood flow through the patient's heart, and also computes things like blood flow and other relevant measurements. The resolution has not seemed to improve in 20 years despite advances in camera technology and other areas, so he is stuck using this old technology.
I was intrigued by [this page][3] on the Wolfram site regarding volumetric visualization and manipulation of 3D visuals based on image slices.
It appears Mathematica can do exactly the same thing that the medical imaging system does, for about 1/30th the price, and produce better results, and also not lock someone into a proprietary file format. Also, Mathematica would permit many additional features such as statistical analyses and various other features across large volumes of collected patient data. Currently, that is a manual process involving data entry into Excel spreadsheets, if it is even done at all.
Has anyone used Mathematica for nuclear medicine?
[1]: http://community.wolfram.com//c/portal/getImageAttachment?filename=UPPER_LIMIT_slices.jpg&userId=1290344
[2]: http://www.medx-inc.co/index2e5c.html?fuseaction=products.236&
[3]: http://reference.wolfram.com/language/tutorial/VolumeRenderingAndProcessing.htmlAndrew Watters2018-02-23T11:34:42ZMake Mathematica's interface less blurry?
http://community.wolfram.com/groups/-/m/t/1202244
I run Mathematica 11.2 in Windows 10. I have a 4k monitor (resolution 3840x2160) at work and another at home running at recommended 150% scale. The Mathematica interface looks really blurry and it is painful to read (see attached image, the window behind Mathematica is the browser window where this message was being composed. Browser text is very sharp, as is the rest of Windows. Mathematica text is blurry).
My laptop (Surface book) runs at a resolution of 3000x2000 and 200% scale and Mathematica there looks even blurrier.
High dpi monitors have been out for many years and Mathematica has always been blurry for me on them. Is there a way of making it give good text? Am I missing some non-obvious setting that improves this?
Luis.Luis Rademacher2017-10-13T02:23:21ZMaTLink (Matlab==>Mathematica)
http://community.wolfram.com/groups/-/m/t/1290731
I am Hamed, I have MATLABR2015a and Mathematica 11.1.1.0, I will now want to install MATLink to allow a quick and easy transition from Matlab to Mathematica. The version of MATLink 1.1 does not work on my computer can someone help me please?Hamed BOUARE2018-02-23T12:47:50ZCatch up on documentation
http://community.wolfram.com/groups/-/m/t/1290522
A great deal of functionalities is undocumented despite being around in the same form for a long time.
While many of them are 'documented unofficially' here or on mathematica.stackexchange the fact the they are not officially supported means:
- we can't expect WRI Support to answer (though they are helpful more than they need to)
- it is very risky to build commercial solutions using them, and very cumbersome without them
I would really prefer that than anything new.
I'm talking about:
- **PacletManager`*** (Paclets, PacletInfo.m and all related)
Absolute must, how come it is not documented when it is now the standard way of managing/distributing packages?
- **Internal`*** (at least partially)
People use InheritedBlock, WithLocalSettings, HandlerBlock! [**all the time**.][1] They are really helpful
- **Language`***
Responsible for dependencies collecting for e.g. CloudDeployed APIFunction/FormFunction. But not only, stuff it contains would be a great help for advanced developers.
Why don't you give us tools as opposed to the solution which does not fit all use cases?
- **DynamicNamespace**, `DynamicLocation` and friends
Extremely helpful framework behind Graph's plotting feature (see what we know so far: [**mma.se.com/q/155237**](https://mathematica.stackexchange.com/q/155237/5478)
- **FrontEnd in general**: ``FrontEnd` `` ``FEPrivate` `` (e.g. AttachedCell) and longstanding bugs
Stagnation in this area saddens me deeply so I will just make a note that I care :-) And I know that supporting three front ends on different OSs and browsers is a huge task.
There are cases of hard to debug issues that were not fixed since, sometimes, V9. If you are not planning to fix them maybe it is time to talk about them in *PossibleIssues* section as I understand that they not always are pure bugs but a side effect of subtle optimization patches.
----------
Did I forget about anything? Do you agree?
[1]: https://mathematica.stackexchange.com/search?q=InheritedBlockKuba Podkalicki2018-02-23T07:12:59Z[✓] Make a 3D scatter plot using multiple data sets imported from excel?
http://community.wolfram.com/groups/-/m/t/1290300
I have multiple data sets in several excel (.xlsx) files that I want to visualize as a single 3D scatter plot. I can import each data set individually and plot them using the ListPointPlot3D command:
data3 = Import["/Users/hewittwm/Documents/Mathematica/data3.xlsx"]
ListPointPlot3D[data3, BoxRatios -> 1, PlotRange -> {{0, 3000}, {0, 1}, {0, 1}}, AxesLabel -> {"Volume", "Buriedness", "Hydrophobicity"}]
data4 = Import["/Users/hewittwm/Documents/Mathematica/data4.xlsx"]
ListPointPlot3D[data4, BoxRatios -> 1, PlotRange -> {{0, 3000}, {0, 1}, {0, 1}}, AxesLabel -> {"Volume", "Buriedness", "Hydrophobicity"}]
But when I try to plot both together:
ListPointPlot3D[{data3,data4}]
I get an error saying "must be a valid array or a list of valid arrays"
How do I resolve this? Is there a better way to go about plotting my data points in 3D? Any advice would be greatly appreciated as I am fairly new to Mathematica and the Wolfram Language.William Hewitt2018-02-22T21:08:15ZWordDefinition function in 10.3 fails
http://community.wolfram.com/groups/-/m/t/583266
I just installed 10.3. Here is the result of running the WordDefinition function exactly as it appears in the docs:
In[3]:= WordDefinition["dolphin"]
During evaluation of In[3]:= CreatePaclet::badppi: The paclet C:\Users\David\AppData\Roaming\Mathematica\Paclets\Temporary\WordData_Canonicalization-10.0.254656959.paclet does not have a properly formatted PacletInfo.m or PacletInfo.wl file. You can use the VerifyPaclet function to get more detailed information about the error.
During evaluation of In[3]:= PacletInstall::instl: An error occurred installing paclet from file C:\Users\David\AppData\Roaming\Mathematica\Paclets\Temporary\WordData_Canonicalization-10.0.254656959.paclet: Not a valid paclet.
During evaluation of In[3]:= WordData::dlfail: Internet download of data for WordData failed. Use Help > Internet Connectivity... to test or reconfigure internet connectivity. >>
During evaluation of In[3]:= CreatePaclet::badppi: The paclet C:\Users\David\AppData\Roaming\Mathematica\Paclets\Temporary\WordData_Canonicalization-10.0.254656410.paclet does not have a properly formatted PacletInfo.m or PacletInfo.wl file. You can use the VerifyPaclet function to get more detailed information about the error.
During evaluation of In[3]:= PacletInstall::instl: An error occurred installing paclet from file C:\Users\David\AppData\Roaming\Mathematica\Paclets\Temporary\WordData_Canonicalization-10.0.254656410.paclet: Not a valid paclet.
During evaluation of In[3]:= WordData::dlfail: Internet download of data for WordData failed. Use Help > Internet Connectivity... to test or reconfigure internet connectivity. >>
Out[3]= Missing["NotAvailable"]David Keith2015-10-16T00:40:48ZConnect to a FileMaker .fmp12 database using DatabaseLink?
http://community.wolfram.com/groups/-/m/t/1289467
Using `DatabaseLink`, Is it possible to connect to and query a FileMaker `.fmp12` database? If so, how?Murray Eisenberg2018-02-21T21:59:27ZLoad a function from cubin, ptx or library file using CUDAFunctionLoad?
http://community.wolfram.com/groups/-/m/t/1289656
According to the documentation of `CUDAFunctionLoad` it should be easy to specify a compiled file (cubin, ptx, dll should all work) as the source for loading a `CUDAFunction`. Unfortunately it does not for me. Compiling from source works fine, but as soon as I try to load the `CUDAFunction` from the compiled file (I tried cubin, ptx and a dll) things fail.
Here is a very simple example that does not work for me, no matter what combination I try:
Let's create a cubin file first from a very simple CUDA kernel:
code = "
__global__ void addTwo(int * in, int * out, int length) {
int index = threadIdx.x + blockIdx.x*blockDim.x;
if (index < length)
out[index] = in[index] + 2;
}";
CreateExecutable[code, "test", "Compiler" -> NVCCCompiler,
"CreateCUBIN" -> True, "TargetDirectory" -> NotebookDirectory[]]
This successfully creates test.cubin in the `NotebookDirectory[]`.
Unfortunately loading the function addTwo fails:
cudaFun =
CUDAFunctionLoad[File[NotebookDirectory[] <> "test.cubin"],
"addTwo", {{_Integer, _, "Input"}, {_Integer, _,
"Output"}, _Integer}, 256, "ShellCommandFunction" :> Print,
"ShellOutputFunction" -> Print];
> CUDAFunctionLoad::invsrc: CUDALink encountered invalid source input.
> The source input must be either a string containing the program, or a
> list of one element indicating the file containing the program.
The input file should be valid, but maybe I am missing something obvious here. Interestingly enough going the same route creating a .ptx file yields a different error:
CreateExecutable[code, "test", "Compiler" -> NVCCCompiler,
"CreatePTX" -> True, "TargetDirectory" -> NotebookDirectory[]]
cudaFun =
CUDAFunctionLoad[File[NotebookDirectory[] <> "test.ptx"],
"addTwo", {{_Integer, _, "Input"}, {_Integer, _,
"Output"}, _Integer}, 256, "ShellCommandFunction" :> Print,
"ShellOutputFunction" -> Print];
> CUDAFunctionLoad::notfnd: CUDALink resource not found.
In addition to cubin and ptx files I tried compiling a library file using `CreateLibrary`, which was created fine but also could not be loaded using `CUDAFunctionLoad`.
Any ideas on what is going wrong here and how I can actually load a CUDAFunction from a compiled file?
Additional Information:<br>
I am running Mathematica 11.2 on Windows 10.<br>
CUDA is setup properly and I can do all CUDA computations in Mathematica.Wizard2018-02-22T02:06:27ZLive code templates
http://community.wolfram.com/groups/-/m/t/1273720
## Background
I enjoy coding in the FrontEnd (except it crashes and lookup across files does not exist), but I often miss 'hands on keyboard', customizable code templates.
E.g. I often forget to wrap an option name with quotes "_" or I'm starting a new function and would like to avoid retyping `Attributes/Options` `Catch/Check` etc.
I don't like palettes for something that I need to do quickly and frequently.
So I created a little stylesheet, for 11+ (v10 on todo list) and in a *beta* stage at the moment.
Should work on Win/MacOs. Do not use on pre V11 as it may crash the FE.
https://github.com/kubaPod/DevTools
I case you are interested and/or have any ideas about this / similar features, let me know here or create an Issue in GitHub.
Topic cross posted on Mathematica.stackexchange: https://mathematica.stackexchange.com/q/164653/5478
## Setup
(*additional package I use to install github assets' paclets,
you can download .paclet manually if you want
*)
Import["https://raw.githubusercontent.com/kubapod/mpm/master/install.m"]
Needs["MPM`"]
(*installing the package*)
MPMInstall["kubapod", "devtools"]
(*changing default .m stylesheet to a dev's stylesheet*)
CurrentValue[$FrontEnd, "DefaultPackageStyleDefinitions"] =
FrontEnd`FileName[{"DevTools", "DevPackage.nb"}]
(*test*)
FrontEndTokenExecute["NewPackage"]
## How to:
- <kbd>Ctrl</kbd>+<kbd>1</kbd> to open a menu
- navigate with arrows and hit enter/return or hit a shortkey like <kbd>n</kbd>
/ <kbd>{</kbd> / <kbd>[</kbd>
## Customization
Once you setup a new stylesheet the package should have an additional toolbar with 'Edit code templates' button on the top right. Click on it and a user's templates file should open.
It is just a .m file with a header that should explain everything. It will be improved in future.
## Example
[![enter image description here][1]][1]
There is also a dark one based on a build-in ReversedColors.nb stylesheet:
CurrentValue[$FrontEnd, "DefaultPackageStyleDefinitions"
] = FrontEnd`FileName[{"DevTools", "DevPackageDark.nb"}]
[![enter image description here][2]][2]
[1]: https://i.stack.imgur.com/v81cV.gif
[2]: https://i.stack.imgur.com/g96TY.gifKuba Podkalicki2018-01-28T18:00:23ZLittle pieces of code for graph and networks theory
http://community.wolfram.com/groups/-/m/t/98022
I thought it would be nice to have a discussion of little pieces of Mathematica code that can help when working with graphs and networks. Here for example, one to undirect graphs when needed:
[mcode]ToUndirectedGraph[dirGraph_] :=
Graph[VertexList@dirGraph, #[[1]] \[UndirectedEdge] #[[2]] & /@
Union[Sort[{#[[1]], #[[2]]}] & /@ EdgeList@dirGraph]][/mcode]or what about a graph planarity check function (i.e. adding any edge would destroy its planarity):[mcode]MaxPlanarQ[graph_] :=
PlanarGraphQ[graph] &&
With[{pos =
Select[Position[Normal@AdjacencyMatrix@graph,
0], #[[1]] < #[[2]] &],
vertex = VertexList[graph],
edges = EdgeList[graph]
},
val = True;
Do[If[PlanarGraphQ[
Graph[Append[edges,
vertex[[i[[1]]]] \[UndirectedEdge] vertex[[i[[2]]]]]]],
val = False; Break[]], {i, pos}]; Return[val]][/mcode]And one to produce random permutations for a given graph with the indicated number n of nodes:[mcode]PermuteGraph[g_, n_] :=
Table[AdjacencyMatrix@
Graph[RandomSample[VertexList@g], EdgeList@g], {n}][/mcode]What about code for counting sizes of graph automorphism groups? I have some, but it uses Saucy, an open-source software that has been tested to be (surprisingly) in practice very fast, despite the NP question underlying this task (unknown whether it has a polynomial time algorithm or it is NP-complete). There is a function in Combnatorica but you can read about its drawbacks in the [url=http://mathworld.wolfram.com/GraphAutomorphism.html]graph automorphism[/url] page in MathWorld.Hector Zenil2013-08-15T18:51:44Z[✓]Create a network of 300 nodes that can be clustered into 100-node chunks
http://community.wolfram.com/groups/-/m/t/1288902
I have a rather basic problem where I am asked to create a network of 300 nodes that can be clustered into 100-node chunks. Essentially, the nodes have many connections within a chunk and comparatively few between different100-node chunks.
For example, if I made the connections with a chunk occur with 100% probability and between chunks occur 0% I get the following:
edges = {};
For[l = 1, l <= 3 , l++, h = 100*l;
For[n = 100 (l - 1) + 1, n < 100*l + 1, n++,
For[m = n + 1, m <= 300, m++,
If[m <= h,
If[RandomReal[{0, 1}] > 0.0, AppendTo[edges, n <-> m]],
If[RandomReal[{0, 1}] > 0.99, AppendTo[edges, n <-> m]]]]]]
![enter image description here][1]
which is expected and gives a corresponding MatrixPlot of the Adjacency Matrix as:
![enter image description here][2]
Which is also all well and good. Now, something very strange seems to be going on when I try to make the connections between the 100-node chunks be non zero. For example, if I made the probability be 1%, the folowing is obtained:
![enter image description here][3]
This looks ok, but it becomes very evident that there is a problem when one looks at the corresponding Matrix Plot of the Adjacency Matrix
![enter image description here][4]
Evidently, there is a very big problem somewhere. I did try to check this in a bit more detail and it seems that everything is working properly with the Matrix Plot. It seems that there is somewhere a problem with my code - but where? The code, in my opinion, seems rather simple and straightforward. I am really confused with what the issue is and could use assistance, it doesn't seem possible that Mathematica would have a problem with something so basic.
[1]: http://community.wolfram.com//c/portal/getImageAttachment?filename=Capture1.PNG&userId=1288488
[2]: http://community.wolfram.com//c/portal/getImageAttachment?filename=Capture2.PNG&userId=1288488
[3]: http://community.wolfram.com//c/portal/getImageAttachment?filename=Capture3.PNG&userId=1288488
[4]: http://community.wolfram.com//c/portal/getImageAttachment?filename=Capture4.PNG&userId=1288488Boris Barron2018-02-20T16:41:48ZSet Image acquisition ($ImagingDevice) on Unix?
http://community.wolfram.com/groups/-/m/t/1288310
When I do<br>
$ImagingDevice
I get the following message
Message[$ImagingDevice::notsupported, "Unix"]
What can I do to fix it?Santiago Hincapie2018-02-19T23:04:51Z