Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing Financial Toolbox dependency #1

Open
toshiakit opened this issue Aug 3, 2023 · 1 comment
Open

Removing Financial Toolbox dependency #1

toshiakit opened this issue Aug 3, 2023 · 1 comment

Comments

@toshiakit
Copy link

Hello, plotPolarAnimation.m requires Financial Toolbox, but I think you can remove this dependency fairly easily.

Line 81: angle = daysIntoYear * (2*pi/yeardays(date.Year)); can be rewritten as follows:

numYearDays = days(datetime(date.Year+1,1,1) - datetime(date.Year,1,1));
angle = daysIntoYear * (2*pi/numYearDays);

Line 85: prev_angle = prev_daysIntoYear * (2*pi/yeardays(prev_date.Year)); can be changed to

numYearDays = days(datetime(prev_date.Year+1,1,1) - datetime(prev_date.Year,1,1));
prev_angle = prev_daysIntoYear * (2*pi/numYearDays);

With those changes, I was able to run your Live Script without error, even though I don't have Financial Toolbox.

@davidwilby
Copy link
Contributor

Hi @toshiakit thanks for your input, I really appreciate the effort.

For this particular example, having a toolbox as a dependency is intentional as this will form part of a future demonstration of putting together reproducible projects, with dependencies being an important component.

Though arguably, your solution is another route to reproducibility by removing a dependency that is only minimally used. I'll bear this in mind, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants