17,930 reputation
12160
bio website
location
age
visits member for 2 years, 3 months
seen 4 mins ago

3h
revised How do I count a number of primes(say smaller than N) that does not contain 5?
use Artes method to find all primes less than n
3h
comment How do I count a number of primes(say smaller than N) that does not contain 5?
@Artes thanks. I knew there must be a better way to find primes less than N. Will update this part to use your method.
3h
revised How do I count a number of primes(say smaller than N) that does not contain 5?
deleted 8 characters in body
3h
revised How do I count a number of primes(say smaller than N) that does not contain 5?
deleted 8 characters in body
3h
answered How do I count a number of primes(say smaller than N) that does not contain 5?
20h
comment Linear functions
x^2/x+3 is just x+3, right? So straight line. You are asking to find asymptote to a straight line?
20h
comment ListPlot, PlotMarker -> y value
you mean like this? (change your plot marker with) PlotMarkers -> m[[1, i]]] there is was value associated with the symbol valueY you had. m = {{33, 11, 2}, {3, 5, 4}, {6, 4, 8}} Table[ ListLinePlot[m[[i, All]], PlotLabel -> i, PlotMarkers -> m[[1, i]]], {i, 3}]
1d
revised Numeric function not fully evaluating
clean code
1d
comment How to determine three last bindings made to a variable when evaluating an expression?
Make a class that represents the variable (as say with Java's Integer class), with private array that keeps track of all assignments/time stamp/counters, etc.. all hidden inside the class, Supply a set[] and get[] methods to the clients of your variable to use on the variable once it is instantiated. Making such Class in M is very easy. Make a Module, and inside the Module create the local variables and private methods. see mathematica.stackexchange.com/questions/586/… for one example.
1d
comment Numeric function not fully evaluating
Just move the a from the Block to gobal. You are using a in h[t] but h[t] does not see it. screen shot: !Mathematica graphics I do not know where the e you show came from. I do not see this on my end.
2d
comment Mathematica examples with many calculations?
1. use ; to suppress output. 3. use Module or Functions (just like you'd do in any other programming language to avoid global variable sharing). for 2. I do not understand what you mean. An example would help.
2d
comment How to solve this integral equation?
The problem I think is that you have a pole, when s=c x even though x is unknown, it has to be between -Infinity and +infinitym right? So somewhere along the real line, is a pole. So does not converge
2d
comment Issue with Set function
I can't follow your code, too advanced for me. But when I wanted once to index by column and give it a tag/name, I simply made few costants, like this: NAME=1;DATE=2;. then for matrix say m={{"joe doe","1/1/2001"},{"joe doe 2","1/1/2002"}}, I would write m[[All,NAME]] and m[[2,DATE]] and so on. it works and was easy to handle. Not as nice as dictionary ofcourse. Just had to remember to make sure the names of columns and the index matched what I wanted.
2d
comment TableDirection in TableForm
It just means m = {{a, b}, {c, d}, {e, f}}; {dim1, dim2} = Dimensions[m] gives {3, 2} which is 3 rows and 2 columns. The docs used outermost since 2 is the last entry in the dimensions? The dimensions are row first, then cols second. So in a sense, column is the outer. I would not really pay big attention to these terminolgies used. As long as you know how to use it. I can't understand half the documentation most of the time. I just figure what to do by trial and error then I understand how to use.
2d
comment TableDirection in TableForm
if m is your list {{a, b}, {c, d}, {e, f}}, then {a,b} is the first row, right? and {c,d} is the second row, and {e,f} is the third. So by default, TableForm, prints each row in a new line. That is what you see in the first example. The second example is just this: TableForm[Transpose@m] so it just prints each column on a new line.
Apr
19
comment Inhomogeneous phase-portrait with StreamPlot
I do understand your Matlab code here: You write f=@(t,Y) [Y(2); -1/2*Y(1)*(1000-1250/sqrt(1+625*Y(1)^2))]; but where is t in the RHS of the function f? Why are you defining f to accept (t,y) when t is not used in the function body? as for the main issue, I think one needs to understand your matlab code more to make sure what you are doing there and in Mathematica are mathematically equivalent. Having the Matlab code there helps.
Apr
19
comment Inhomogeneous phase-portrait with StreamPlot
Can you please post the matlab code also? You can have an error in the translation.
Apr
19
comment Questions about CountryData
@belisarius table form of output from your command (added formting) !Mathematica graphics Who would have thought that the country of Niue, wherever this country is, would have 100% of its population be internet users? The US is 16 on the list ! not good.
Apr
19
comment Inhomogeneous phase-portrait with StreamPlot
a must-be simple streamplot. what does a simple streamplot mean? do you have an example of what the output is supposed to be from your book to compare? or explain more what is wrong with this. You need more lines? Scale is off? etc...
Apr
19
comment How to switch elements i,j in a list?
If you do not want to type the reverse list, you can try m = {1, 4, 3, 2, 5}; idx = {1, 2, 4}; m[[idx]] = m[[Reverse[idx]]]; I also do not know why you need to save the actual data in the position affected. You have the index of the positions switched there. So you can always obtain the data that was switched anytime. Save memory ! Just do oldData = m[[Reverse[idx]]] to read the old data