this post was submitted on 22 May 2024
28 points (96.7% liked)

Open Source

28934 readers
348 users here now

All about open source! Feel free to ask questions, and share news, and interesting stuff!

Useful Links

Rules

Related Communities

Community icon from opensource.org, but we are not affiliated with them.

founded 4 years ago
MODERATORS
 

Hello! In qalc I can do calculations using measuring units like this:

> 5 W * 3 s

  (5 watts) × (3 seconds) = 15 J

I'd like to be able to do something similar also in GNU Octave. I think the symbolic library could be a place to look at, but I found nothing "already done". Do any of you know of a way to achieve this functionality?

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 1 points 1 month ago (2 children)

I don't think symbolic will solve your problem at all

[–] [email protected] 1 points 1 month ago (1 children)

With symbolic variables J, s and W, the Ws won't be converted to J automatically.

[–] [email protected] 2 points 1 month ago

automatically no, but perhaps there's a way to replace it. If there's a way to check if a variable is "divisible by another symbolic one" then it would be not so hard to implement this behavior