I had it that way first, but I figured in the screenshot I posted to advertise on Facebook non-programmers might ask why you need the quotes when you don't in something like Wolfram Alpha, so I thought well technically you can do it without them.
@Mr.Wizard Just out of curiosity did you ever get change to see if this mathematica.stackexchange.com/q/29779 could modified so that you do something like this runPrivate[Global`a = 1]
The easier way (well the only way I can think of) is having Global`a evaluate to the longer form runPrv`a, but that would require to set the global outside the function and it would require you to keep the context visible (not removed)
Ok. If nothing else I think you could/should be able to automate what I posted above as a function call inside the Block element. Then you could export internal values into the Global` context
This is possible, at least in version 7, but as rcollyer supposed there is a Global security option which cannot be set from within the Notebook (automatically, that is).
First change the Global option:
SetOptions[$FrontEnd,
GlobalInitializationCellWarning -> False
]
Then in the Notebook yo...
@Kuba Did SetOptions[$FrontEnd, GlobalInitializationCellWarning -> False ] do what you want? Have you considered the NotebookDynamicExpression alternative posted there too?
Manually set in Option Inspector works for Global Preferences but not for Selected Notebook, I'm testing now if I can use information you've provided for single notebook
I have a n x m matrix of data.
How do I create a function that has a sum that includes elements of each column, such that if I input a value, I would get a 1 x m row (where m > 100)?
More specifically, I am computing a discrete fourier transform of the data in each column that should work for a...
@Mr.Wizard First thought is that OP is looking for Total /@ Transpose[m], where he want to switch Total with DFT but things which he is writing about it make me less confident about what to think about it
@Mr.Wizard I think he wants something like dft = Fourier /@ Transpose@matrix, but his DFT formula is wrong. Then the "extension" he seeks would be dft[[All, f+1]] or he could transpose dft.
just curious, why sometimes stackexchange gives +15 points for accepted answer and puts green circle around it, but sometimes it just makes the green circle but the number will be zero inside it instead of +15 ?
Some questions and answers are marked Community Wiki and are owned by a Community Wiki user.
Why have Community Wiki posts?
How do Community Wiki posts work?
How does a post become a Community Wiki post?
How can the Community Wiki status be removed from a post?
Return to FAQ Index
CellPrint@ Cell@StyleData["MyStyle", StyleDefinitions -> StyleData["Input"]] Then copy and paste into the new style sheet. There might be an easier way.
any one knows if this question was asked before? not able to find an answer and wanted to post it, thought to check first. I need to change the file name displayed at the top left corner to be full name path. Like this:
I can't find a setting or option, and hard to google this. Should I post this, or already asked?
I've just used DynamicModule when I want to preserve state when I restart Mathematica. I just use Module otherwise, but there might be some subtleties.
@MarianoSuárez-Alvarez Alternately, go to Format > Edit stylesheet, enter the name of your style, select the new cell and press Cmd-Shift-E (on a mac) and add StyleDefinitions -> StyleData["Input"] as an option to StyleData["mystyle"]
@MichaelHale I'm using DynamicModule at the moment, hence my choice of that function over Module. But my question is the same for both, are there any benefits in localizing function arguments?
Oh, not that I can think of. SetDelayed already scopes the variables for you. I just use Module if I'm adding extra explanatory variables that I use within a function definition that aren't already defined as arguments.
@Calle I agree with @MichaelHale, but there is a difference. The value 0.2 will replace all instances of x in the code when func[0.2] is executed, and then the code is evaluated. The value of xarg will replace an instance of xarg only when it is evaluated in the course of evaluating the code.
@Calle And generally I would say one should use Module unless you have a reason to use DynamicModule (and there are many good reason to use DynamicModule).
@halirutan I would add that Manipulate does many things automatically. Sometimes its choices are not the choices you want and only annoy you.
@halirutan Sure. I just have not found a case where I can't control something using Manipulate. but I am just a newbie compared to you, so I am sure I missed something.
I used DynamicModules few times, and found it so confusing. All these explicity Dynamic[this] and Dynamic[that] do not lead to easy to read code.
I have some code which displays a GraphPlot and allows the user to click on any vertex in the graph to display some information about that vertex in a popup window. There is two-way highlighting between the popup and the vertex, so that if the user hovers over either the vertex or the popup windo...
@Nasser @MichaelE2 @halirutan I find Manipulate horrible and unintuitive. To each his own. But one good reason to use DM is greater flexibility in layout design and control positioning.
@MikeHoneychurch Actually all of Dynamics is confusing ) but for me Manipulate is less confusing than DM.
We need more questions here like on the matlab group. How to add a number to a row, and how to remove a column from a matrix and so on. Matlab group is much more fun than here :)
@Nasser i would have thought just about every List question has been asked and answered. Sometimes I suspect duplicates but cannot find them. There seems to be a lot of "homework" type questions from new users lately.
We need a question on recursive descent parsers... it's supposedly the most amazing paradigm ever and MMA is supposedly very well suited for it... but the Wikipedia article is quite intricate and well, I don't know how to write a question about that suits the SE format :(
I am afraid that M is drifting to new area, far away from its origins of pure Mathematica and physics and engineering. All this data stores and data collections and such. But what do I know...
any one like to do a quick test for me for a small demo? it allows one to select row/column and channel number of an image and show the selection result. It is meant to help someone learn the ImageData matrix layout for an image
@rm-rf I'm working on it but currently I have a student from Hungary in our house. She wants to learn German and I didn't have much programming time these days.
@rm-rf And sadly enough my wife sent me an email today and told me that family voting is not allowed :-(
@MikeHoneychurch Actually I find most of Mma unintuitive. But after I've mastered a few things here and there, other things fall into place. Then it seems intuitive. I pored over the Manipulate/Dynamic tutorials, but Manipulate did not seem that hard, except that it does things that sometimes get in your way. In part that has to do with the kind of programming I was doing before. I wouldn't call Manipulate horrible, but I wouldn't call it intuitive either.
@MrWizard sz pronounced like s in salt a pronounced like a in what (British received pronunciation, not American) b - what you expect (b in bee) o - like o in German or Italian l - what you expect (like l in light) cs - like ch in China :-)
Ok, here is the small demo. If someone can just please play it to see if it looks ok. it just shows the ImageData matrix layout for an image... 12000.org/tmp/080613 any problems pls let me know.. still beta
Just select the row/column and channel to see which part of the image that is, and see the 3D matrix to do that.