Clear Filters
Clear Filters

how to plot bloch sphere

28 views (last 30 days)
Sowmya on 27 Mar 2023
Edited: DGM on 27 Mar 2023
There is a function plotBlochSphere and installed all the required support package. But still showing axis errors. Please help
Error using
Complex values are not supported.
Error in axis>LocSetLimits (line 293)
Error in axis (line 114)
Error in plotBlochSphere (line 28)
axis([-limits limits -limits limits -limits limits]);
  1 Comment
DGM on 27 Mar 2023
Edited: DGM on 27 Mar 2023
Let's see.
The error message does not match the code of the plotBlochSphere() function given here
or the plotBlochSphere() function given here
It instead matches this plotBlochSphere() function
which wasn't even on the first page of search results. The variable 'limits' is being set to a complex value directly by you in your call to the function. How you're calling the function is unknown, but 'limits' needs to be a real-valued scalar.
I like how everything in that FEX submission is a function wrapped up as a livescript with no script content because someone doesn't know how to write a function synopsis. I especially like how everything being published as .mlx means that Firefox needs to eat three CPU cores for over six minutes in order for the page to render 30 lines of code.

Sign in to comment.

Answers (1)

Torsten on 27 Mar 2023
Moved: Torsten on 27 Mar 2023
Too little information to give a helpful answer.
But apparently, you got complex results that cannot be plotted.


Find more on Quantum Mechanics in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!