Skip to content

MATLAB.jl function but not Plotting. #241

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

Closed
ColtonKawamura opened this issue Apr 19, 2025 · 4 comments
Closed

MATLAB.jl function but not Plotting. #241

ColtonKawamura opened this issue Apr 19, 2025 · 4 comments

Comments

@ColtonKawamura
Copy link

ColtonKawamura commented Apr 19, 2025

On MacOS 15.3.1, using Julia Version: Version 1.11.5 (2025-04-14) with a recent build of MATLAB.jl and a trial version of MATLAB which is R2024b:

julia> using MATLAB

julia> mat"2+2"
WARNING: package sun.awt.X11 not in java.desktop
WARNING: package sun.awt.X11 not in java.desktop
4.0

which works fine. But when I try to bring up a figure:

julia> mat"figure"

julia> 

I get no figure piping up like I do on my work computer. The only difference between the two is that I'm using 2024a on the computer that works with my work license which I cannot share the license with my personal computer which is running 2024b (trial).

I assume the issue is because it's either trial or 2024b but open to suggestions.

@tqml
Copy link
Collaborator

tqml commented Apr 19, 2025

Hey @ColtonKawamura

Just to make sure: Plotting from MATLAB.jl works on your Work PC?

Could you try starting a new session as described in #240 (comment) ?
Does plotting work then?

@ColtonKawamura
Copy link
Author

@tqml Thanks so much for your reply! It does function as desired on my work Mac.

I tried the new session method without success:

julia> mat"2+2"
4.0

julia> mat"figure"

julia> new_session_flags = ""
""

julia> new_session = session = MATLAB.MSession(MATLAB.default_output_buffer_size; flags=new_session_flags)
WARNING: package sun.awt.X11 not in java.desktop
WARNING: package sun.awt.X11 not in java.desktop
MSession(Ptr{Nothing} @0x000000030300f590, UInt8[0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], Ptr{UInt8} @0x0000000158008000)

julia> MATLAB.close_default_session()
ERROR: UndefVarError: `close_default_session` not defined in `MATLAB`
Suggestion: check for spelling errors or missing imports.
Stacktrace:
 [1] getproperty(x::Module, f::Symbol)
   @ Base ./Base.jl:42
 [2] top-level scope
   @ REPL[12]:1

julia> MATLAB.default_session_ref[] = new_session
ERROR: UndefVarError: `default_session_ref` not defined in `MATLAB`
Suggestion: check for spelling errors or missing imports.
Stacktrace:
 [1] getproperty(x::Module, f::Symbol)
   @ Base ./Base.jl:42
 [2] top-level scope
   @ REPL[13]:1

julia> mat"2+2"
4.0

julia> mat"figure"

julia> 

@tqml
Copy link
Collaborator

tqml commented Apr 22, 2025

My fault, I had a typo in my original snippet:
its close_default_msession and not close_default_session as well as default_msession_ref instead of default_session_ref.

Nevertheless, I tested it and my proposed workaround does not work with the latest release.
I will make some adjustments and merge #240 this week so that plotting is possible again.

@ColtonKawamura
Copy link
Author

Ok thank you very much!

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