Reputation
34,008
Next tag badge:
92/100 score
27/20 answers
Badges
1 48 118
Impact
~398k people reached

Jan
7
comment how to import plain text file, with mixed formats with strings that contain commas
great! this option did it. I am surprised no one mentioned this option in all the questions I looked at.
Jan
7
comment how to import plain text file, with mixed formats with strings that contain commas
@m_goldberg as I mentioned in the post, I get an error when using CVS. I also renamed the file as cvs and tried it. I mentioned this in the question, I am on windows 7, 10.3.1. Please see 3) above. It could be a different OS thing issue.
Jan
6
comment How to set the relative directory so that they work both in script and in notebook and portable?
again, you do not need to SetDirectory["../data"]; to export to it. Just add the path to the file name. See first if the linked answer works for you.
Jan
6
comment How to set the relative directory so that they work both in script and in notebook and portable?
When the notebook or script is run, there is a default current directory that is set, which is different from the actual directory where the script or the notebook is located. On windows 7 it says C:\Users\<user_name>\Documents. So you have to correct this to the actual current directory where the notebook or the script is first. Then from there, you can go one level above to the data directory. I do not know where your script is located. May where it is located there happened to already data directory above it so it worked.
Jan
6
comment How to set the relative directory so that they work both in script and in notebook and portable?
i.e if can determine that the script directory is c:\my_folder\my_code then the data directory will be c:\my_folder\data. Right?
Jan
6
comment How to set the relative directory so that they work both in script and in notebook and portable?
I just need to export the data to the folder data which is one level up to the current code directory I must be missing something. If you can find out the current code directory (which is what the answer linked to shows), then you know the folder above it. So I do not know what is the issue. You also do not have to set directory to save to it. You can just construct the file path.
Jan
6
comment How to set the relative directory so that they work both in script and in notebook and portable?
This was asked before. analogue-of-notebookdirectory-for-scripts-to-get-the-directory-path-of-my-scr so once you know current directory of script, you can now do the rest.
Jan
4
comment Some time difficulty in a Manipulate program inside a DynamicModule
I was mostly concerned about what would be the simplest way for students to handle this problem who are brand new to Mathematica. I think you should stick to Manipulate only. This is much simpler for students who are new to Mathematica, rather than start with DynamicModule. Manipulate simplifies many things and it is a simple framework to start with. I've had a course in physics, where many students never used M before, and many struggled just with basic plotting and such. I can't imagine having to start with DynamicModule and Manipulate inside it on top of that.
Jan
4
comment How to automatically have ContourLabels in middle of Contour lines if specific levels are not specified?
Ok, I tried for the last 40 minutes, but too many problems to resolve. This package was done using old graphics and uses too many old options and such, and it will need much longer time to fix. But I think it will be worth it. I am really surprised that WRI did not integrate some of the functions in this package in Mathematica. This package has been around for only 20 years! I guess WRI is busy with cloud computing now and has no time to work on such basic things like contour labels location :)
Jan
4
comment How to automatically have ContourLabels in middle of Contour lines if specific levels are not specified?
Thanks for the link. I downloaded and installed it. But as expected, it does not work with 10.3.1. This is an old package from version 3.0 ! I get lots of errors: !Mathematica graphics but what I will do next, is locate this specific function in the package, and try to make it work for 10.3.1. I've always had problems running old packages in new Mathematica versions. Something always changes. The LabelContour function is very complicated 450 lines long !
Jan
3
comment Change function acting on sum to function acting on each object individually
@Kuba yes, I forgot above the -1, thanks for point it out. But Expand@expr is still needed as well.
Jan
2
comment Why do I get different results for the same input specified using natural language phrasing?
This site is about the Wolfram Mathematica language, not the Wolfram Alpha language. These are not really the same languages, even though they are based on the Wolfram framework. You might be better asking about the Wolfram Alpha language at the Wolfram community website, where there are many Wolfram Alpha language questions posted.
Jan
2
comment make constant some elements of a list
but there should be simple way, the simple way is to use an if statement. This is what one does in any programming language really. I do not see why it would be different in Mathematica. Trying to play tricks like what you wanted to do is the wrong approach to solve the problem. To get better help, please post a minimal example of the actual problem you are working on.
Dec
27
comment Dynamic plot with synchronization of real time
@LeoRon7 the standard method for allocating a buffer when one does not know how much to preallocate, is to allocate it using fixed sizes. (one chunk at a time). Start with say size = n, where is n is some number you decide on. Use Table to allocate it. Then use [[ ]] to write to it. When it fills up, you can allocate another list of size n. And so on. If you need all those chunks in memory, you make a linked list of them. And so on. Here is an example of linked list mathprogramming-intro.org/book/node525.html
Dec
27
comment Problem with a plot for 1D wave equation solution using NDSolve
Here is the full code when I copied and pasted the full code into my notebook, I get syntax errors.
Dec
27
comment Dynamic plot with synchronization of real time
@Kuba I looked at updateInterval, but was not sure if it is more "strict" on getting timing exactly as needed than scheduled task. It says if possible, be done at least every t seconds. This whole subject of "real time" and Mathematica dynamics is very tricky.
Dec
27
comment How does Internal`PolynomialFunctionQ work?
I doubt anyone can answer this, since it requires looking at the source code of the Wolfram Research Mathematica implementation of these algorithms, which only those who work at Wolfram are able to do.
Dec
26
comment Can your Mathematica do the following integral?
Here is a workaround, since it can do it term by term. f = (z - 2) PolyLog[2, z] Log[1 - z]/z^3;Simplify[Integrate[#, z] & /@ Expand[f]] !Mathematica graphics Mathematica seems to be really confused about something here.
Dec
26
comment What's wrong with this while loop index definition?
@Alyosha your code works. It makes indexed variables. Not a list. List uses [[ and indexed variables use [.
Dec
25
comment Why won't something print with desired precision in a while loop?
good example @MichaelE2, but this prints 100 digits: "Print[N[3.14`100, 100]]" :)