0 registered members (),
677
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Pretty Good Calculator
#370861
05/16/11 11:24
05/16/11 11:24
|
Joined: Dec 2000
Posts: 4,608
mk_1
OP
Expert
|
OP
Expert
Joined: Dec 2000
Posts: 4,608
|
Since Matlab is expensive, GNU Octave takes too long to start and the Windows(tm) Calculator ... well ... sucks ... I decided to write my own one, which now needs some testing. http://mk-scape.de/down/pgc.zipIt still doesn't support anything I want but this is going to change in the future. Right now you can do all basic calculations and also use vectors/matrices by placing theirs comonents in parenthesis:
(1,2,3) vector or (1,2;3,4) 2x2 matrix
You can assign values to variables by using = or forward arrow There are some basic functions implemented. Descriptions are available by typing Trigonometric functions are in radians, I'm going to add a DEG/RAD switch later on. You can copy the ans(wer) value to the clipboar by pressing Ctrl+P. Vector multiplication: There are two different operators which can be used.
(1,2,3) * (3,4,5)' does a dot product. Please note that the second vector is transposed using an apostrophe.
(1,2,3) .* (3,4,5) does a component wise multiplication
. You can create a vector of increasing values by using the range operator:
x = 0:255 Create vector of length 256 filled with all numbers from 0 to 255
x = 0:0.5:10 Create a vector from 0 to 10 with steps of 0.5, i.e. (0, 0.5, 1, 1.5, ...)
You can also plot functions but the plot window isn't really done yet and only displays graphs in the range -4 to 4 in x and y. Example:
x = -4:0.05:4
y = plot(sinh(x);cosh(x);tanh(x))
Operators:
+ add
- sub
* mul
/ div
! factorial
= assign to left
-> assign to right
^ power
, column delimiter
; row delimiter
x:y range
x:y:z range with steps unequal 1
Feel free to report any bugs here.
Last edited by mk_1; 05/16/11 11:35.
|
|
|
Re: Pretty Good Calculator
[Re: Joey]
#370865
05/16/11 11:39
05/16/11 11:39
|
Joined: Apr 2005
Posts: 3,815 Finland
Inestical
Rabbit Developer
|
Rabbit Developer
Joined: Apr 2005
Posts: 3,815
Finland
|
One thing seems missing from the operators:
% modulo
"Yesterday was once today's tomorrow."
|
|
|
Re: Pretty Good Calculator
[Re: mk_1]
#370891
05/16/11 15:32
05/16/11 15:32
|
Joined: Jan 2003
Posts: 4,615 Cambridge
Joey
Expert
|
Expert
Joined: Jan 2003
Posts: 4,615
Cambridge
|
.* sounds like "dot product", while * is the common product on the field. also, matlab seemed very inconsistent to me from what i've heard (especially when it comes to naming and function arguments).
what about python? you could use its power and write a latex/mathml exporter for the command line history. just a thought. i don't want to discourage you.
edit: mathematica (and python, by the way) has arbitrary precision. edit2: and mathematica has latex and mathml output. don't you get a license at your university?
Last edited by Joey; 05/16/11 15:42.
|
|
|
|