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.zip

It 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:
Code:
(1,2,3) vector or (1,2;3,4) 2x2 matrix


You can assign values to variables by using = or forward arrow
Code:
a = 3
3 -> a


There are some basic functions implemented. Descriptions are available by typing
Code:
help(function_name)


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.
Code:
(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:
Code:
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:
Code:
x = -4:0.05:4
y = plot(sinh(x);cosh(x);tanh(x))



Operators:
Code:
+ 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.

Follow me on twitter