The tag has no usage guidance.

learn more… | top users | synonyms

0
votes
1answer
131 views

How to write this Matlab code in Mathematica

I have a small hiccup here. I am trying to write my Matlab code for a dynamical system in Mathematica. I have managed to get most of it except one part. The Mathematica code for the system is ...
11
votes
3answers
476 views

Generating assignments and transforming code inside Holding forms when generating code

I have been playing with slightly above trivial code manipulations in Mathematica. I thought Mathematica would be great for this kind of work because of rule replacement and expression manipulation, ...
1
vote
2answers
72 views

Plot for pressure rise per wavelength [closed]

I have another question that i need to ask. I have been struggling in making the graphs for pressure rise per wavelenth. my equation for pressure rise per wavelength is: ...
4
votes
0answers
29 views

Why are Parenthesis not added to CExpression in Package SymbolicC?

The documentation of SymbolicC, more specifically of COperator, states that Parentheses are added as necessary together with the ...
7
votes
1answer
106 views

How to prevent SymbolicC constructs from using the semicolon (;) as the separator?

When putting several SymbolicC expressions in a list, they will usually be joined together with semicolons in the final generated code: ...
1
vote
2answers
180 views

How to generate a range of numbers

Is there a quick and dirty way to generate a list of numbers from 1 to some arbitrary large number in order such that the digits of each number are only 0's, 1's, and 2's? I tried doing ...
1
vote
1answer
69 views

Variables input generation for Minimization in High dimensional space [duplicate]

I'm currently doing optimization in a high dimensional space. I was thinking of giving FindMinimum (or NMinimize not certain ...
2
votes
3answers
194 views

SymbolicC Simplified Displayed

How might I display a simplified SymbolicC below. For example in the following example ...
3
votes
1answer
34 views

Indent SymbolicC [duplicate]

What is they shortest way to automatically indent SymbolicC at the Brackets { and }? For example: ...
3
votes
1answer
95 views

How to make N apply to exponent?

For example, I want to covert y + Sqrt[x] to y + x^0.5, where y and ...
2
votes
1answer
115 views

How can I adjust ContourPlot in Mathematica?

I have problem because of the max point and min point, when I have too high or low data point, it just make it white. Here is example of data ...
1
vote
0answers
59 views

Get rid of external library dependency [closed]

I am trying to generate C code for some functions, which I do not post in full because they are a few hundred lines long. The functions do nothing too fancy: a bunch of dot products, powers and roots. ...
0
votes
1answer
100 views

Graphing the sequence {$p_k$} = $\frac{c - a + dp_{k-1}}{b}$ [duplicate]

Graphing the sequence {$p_k$} = $\frac{c - a + dp_{k-1}}{b}$ I need to know how to graph this function where it automatically plugs in the previous term for $p_{k-1}$, the coefficients are of my ...
12
votes
0answers
359 views

C Code generated from Mathematica not working?

I am a .Net developer. I'm trying to build a Visual C++ application using C code generated from Mathematica (by another person). I don't have Mathematica installed on my machine. When I try to compile ...
5
votes
0answers
169 views

Output most efficient Fortran code by mathematica

I am trying to output most efficient Fortran code by mathematica 9.0 with the method Simon provided: How can I get Mathematica to produce better Fortran code? The expressions is as follows: ...
1
vote
1answer
354 views

Latest Mathematica 9.0 can't use Format.m to generate optimized Fortran code [closed]

Before updating to Mathematica 9.0, I have successfully generated beautiful Fortran code using Mark Sofroniou's Format.m package, which is posted on MathSource. ...
2
votes
1answer
180 views

Optimizing my code to generate symmetric tensors

I have written code that does carries out the following task: Construct a fully symmetric rank-$P$ "tensor" out of a collection of user-input rank-1 vectors, and a rank-2 symmetric tensor $h$. The ...
3
votes
1answer
169 views

Mathematica Library

I created a Mathematica packagr and then I used the Needs function to add the library to my .nb file, but when use a function in my .nb file and the function is built in my library it comes up with ...
7
votes
1answer
2k views

Creating a standalone (executable) from mathematica code

I have written a small mathematica code to input a ".csv" file and output the data in a specific format, in a ".txt" file. I would like to give this program as an executable to my friend as she ...
1
vote
0answers
237 views

matrix with IF/THEN condition

How to generate all posible matrices with some conditions on the elements? I need to make for given $n$ all $n\times n$ matrices $A=(a_{ij})$ with three conditions: I. $a_{ij}=+1$ or $0$ or $-1$. ...
5
votes
1answer
202 views

Using mathematica to discover algorithms?

In Steven Wolfram's blog entries, he discusses using mathematica to discover algorithms. I have tried several different google searches for papers on such topics, and have found none. I suspect this ...
8
votes
1answer
240 views

How do I indent C code generated by SymbolicC?

I'm continuing to experiment with the SymbolicC` package, and it's crucial to be able to inspect the generated code in order to do, well, anything useful with it. ...
7
votes
1answer
144 views

How do I create a function pointer typedef using SymbolicC

I am just getting started with the SymbolicC package, and am trying to figure out how to handle function pointer typedefs, like, say: ...
0
votes
0answers
45 views

Generate effective C/Java code (minimizing operations) [duplicate]

Is it possible to generate C/Java code with Mathematica so that it minimizes number of operations performed? For example, for matrix inverse or determinant? With good caching variables?
43
votes
1answer
1k views

Export Code to Pseudocode?

I'm writing a paper and all my code is in Mathematica. The snippets are mostly simple, and consist of loops, maps, variables, and conditionals. I'd like add it to my paper, however, not many academic ...
3
votes
0answers
121 views

CCodeGenerate and calling external functions

Is it possible to use CCodeGenerate to generate code which calls functions from other C libraries? For example, I would like to do something like this: ...
4
votes
1answer
146 views

Generalization of a rule to N arguments

I am trying to apply a series expansion on a function x[t1,t2,...tn], with an expansion parameter a. For ...
9
votes
2answers
189 views

How can I build an inline documentation utility?

I often have a large function to which I add inline comments, but then I can't see the forest for the trees. How can I make a tool that extracts the comments and tokens within them to generate an ...
28
votes
6answers
2k views

Mathematica Destructuring

Context I'm writing a function that look something like: ...
4
votes
1answer
235 views

Where do I get the mdefs.h file?

I want to generate some C code, and the reference here says that Mathematica comes with a mdefs.h file, but I cannot find it. Is there a place where I can download ...
27
votes
7answers
602 views

What kinds of uses of SymbolicC (introduced in Mathematica 8) do you foresee? Are there any neat examples already?

Mathematica 8 introduced SymbolicC, a set of Mathematica functions that capture C language constructions in the familiar Mathematica tree-like fashion. Additionally, there are functions to write ...