Tag Info

New answers tagged

0

Since you are saving to a text file, how about convert to string first, for example: pl = ToString[#] &[HoldForm[test = x + y]]; Save["file.txt", pl]


0

Is there some reason you are avoiding SetDelayed? That will work like this: x = "Fail!"; test := y + x Save["foo.m", test] FilePrint["foo.m"] test := y + x x = "Fail!" If for some reason that won't work you can use Unevaluated: Remove[x, y, test] y = "Fail!"; test = Unevaluated[y + x]; Save["bar.m", test] FilePrint["bar.m"] test = y + x y = ...


0

Assuming you have values for x and y defined, hence the need for HoldForm: x = 1; y = 2; Block[{x, y}, test = y + x; Save["file.txt", test]]


4

Make this button: Button["Get size", Print@FrontEndExecute[ FrontEnd`ExportPacket[NotebookSelection[], "BoundingBox"]]] Then select the output cell and press the button. It only works when the full output cell is selected (i.e. cell bracket), not just some content within the cell. Reference: http://mathematica.stackexchange.com/a/1411/12 You might ...


1

χ /. First[NSolve[SetV == #/(Cpf (1 - χ)), χ]] & /@ demand or equivalently χ /. First@Solve[SetV == dem/(Cpf (1 -χ)), χ] (-dem + Cpf SetV)/(Cpf SetV) and now (-# + Cpf SetV)/(Cpf SetV)& /@ demand {(-1.92*10^6 + Cpf SetV)/(Cpf SetV), (-2.07*10^6 + Cpf SetV)/( Cpf SetV), (-2.37*10^6 + Cpf SetV)/( Cpf SetV), (-2.72*10^6 + Cpf SetV)/( ...


1

Simple replace should do the trick χ /. {{χ -> (-1.92`*^6 + Cpf SetV)/(Cpf SetV)}} Yields {(-1.92*10^6 + Cpf SetV)/(Cpf SetV)}


5

What you observe is a bug (evaluation leek) inside of TreeForm. In particular, observe this: TreeForm[Unevaluated[Print[5 + 6]]] 11 11 As you see, Print is evaluated twice inside of the TreeForm code. It is apparent bug and I suggest you to report it to technical support.



Top 50 recent answers are included