Can't find function mcx Matlab

253 views
Skip to first unread message

Maurice

unread,
Oct 24, 2021, 9:46:03 AM10/24/21
to mcx-users
Dear,

After downloading MCXStudio and running mcxlab in the MATLAB folder into MATLAB, I can't run any of the examples like demo_mcxlab_basic.m due to the error "unrecognized function or variable mcx.m". This function is indeed not in any of the folders. 

What should I do?

Kind regards,
Maurice

Qianqian Fang

unread,
Oct 24, 2021, 9:53:20 AM10/24/21
to mcx-...@googlegroups.com, Maurice
On 10/24/21 9:05 AM, Maurice wrote:
Dear,

After downloading MCXStudio and running mcxlab in the MATLAB folder into MATLAB, I can't run any of the examples like demo_mcxlab_basic.m due to the error "unrecognized function or variable mcx.m". This function is indeed not in any of the folders.


if you are using Windows, please use the all-in-one installer to install mcxstudio

http://mcx.space/nightly/win64/MCXStudio-nightlybuild-installer.exe


otherwise, you need to run the "mcxsuite_addpath.m" script found at the top level of the unzipped package.



What should I do?

Kind regards,
Maurice
--
You received this message because you are subscribed to the Google Groups "mcx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mcx-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mcx-users/3990b492-8c8d-498e-b0ba-187e2081dda0n%40googlegroups.com.

Enes Menteşoğlu

unread,
Jul 31, 2024, 9:13:08 AM7/31/24
to mcx-users
Hi,
Unrecognized function or variable 'mcx'.

Error in mcxlab (line 497)
    [varargout{1:max(1, nargout)}] = mcx(varargin{1});

Error in Kxxx (line 49)
[flux, detp, vol, seeds]=mcxlab(cfg);
 
im using m2 MacBook and have the issue. I run mxsuite_add.. and even added manually still same issue. Can you help me? Thank you
24 Ekim 2021 Pazar tarihinde saat 16:53:20 UTC+3 itibarıyla fan...@gmail.com şunları yazdı:

Qianqian Fang

unread,
Jul 31, 2024, 1:16:28 PM7/31/24
to mcx-...@googlegroups.com, Enes Menteşoğlu

hi Enes,

you can't run mcx/mcxlab on M2 mac, because MCX needs NVIDIA GPU which M2 mac does not have.

you can, however, run mcxcl/mcxlabcl on your M2 mac, you can see my reply to a similar question posted by Emily previously

https://groups.google.com/g/mcx-users/c/yeaV-1gwUNI/m/FgrohfUVAQAJ

Qianqian

Subham Mukherjee

unread,
Oct 24, 2025, 6:01:20 PMOct 24
to mcx-users
Dear Sir, I could not be able to locate the  "mcxsuite_addpath.m" script in the unzipped folder "mcxlab-win-x86_64-v2025". as i am very new to this platform, can you please help me regarding this.

Qianqian Fang

unread,
Oct 24, 2025, 6:14:09 PMOct 24
to mcx-...@googlegroups.com, Subham Mukherjee

mcxsuite_addpath.m is only included as part of the MCXStudio* packages. Because MCXStudio contains many parts (mcxlab/mmclab/redbird ...), so this script helps setting all paths.

for mcxlab, all you need to do is to add the path of the unzipped folder (where mcx.mex* file exist), and the matlab subfolder.

Subham Mukherjee

unread,
Dec 12, 2025, 9:40:54 PM (13 days ago) Dec 12
to mcx-...@googlegroups.com, fan...@gmail.com
Dear Sir, I hope you are doing well, thank you for your kind previous response, actually, I am currently doing the monte carlo photon simulation through python using the pmcx module on a 3d brain mesh. (minc file). I am looking for a pencil source to launch photons from the air. Can you please help me to implement this? I am sharing you with the code and the screenshots of my simulation to get the 3d visualization. if it is possible, please have a look also, my code also needs to be checked because detectors are unable to collect photons to have fluence values. I am currently working on it.

Best Regards,
Subham Mukherjee
Ben-Gurion University of the Negev
Research Scholar
Dept. of Electrical and Computer Engineering

You received this message because you are subscribed to a topic in the Google Groups "mcx-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mcx-users/5Jgo8cWCQj0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mcx-users+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/mcx-users/ccedc714-1eb3-4257-9fa9-9d2f5412bfc0n%40googlegroups.com.
Source with 9 detectors.py
ss4.png
ss3.png

Subham Mukherjee

unread,
Dec 12, 2025, 9:40:58 PM (13 days ago) Dec 12
to mcx-...@googlegroups.com, fan...@gmail.com
Dear Sir, this is also to inform you that i have been using a spherical source of certain radius to get the visualizations in the napari image viewer. 

Qianqian Fang

unread,
Dec 13, 2025, 11:20:36 AM (12 days ago) Dec 13
to mcx-...@googlegroups.com, Subham Mukherjee
Hi Subham, 

Participating discussions in this mailing list, just like in any other public forum on the Internet, it comes with a set of basic expectations  -- that you must have done your due diligence before asking for help.

If a student come to this mailing list, post his/her homework question and ask, "can you help me implement this?" without describing what he/she has done, then the answer is clearly no.

From the question you asked, I don't think I have spent time reading the documentation, or even the readme -- the very first step when using a new software. If you don't even want to spend your time and purely rely on others kindness to make progress, then you are not going anywhere.


Here is your assignment:

First, read the entire article "how to ask questions the smart way", especially this section on what you need to do before asking your question


Second, read pmcx's webpage, 


run those provided examples, and also read/run other examples in this Jupyter notebook to understand how it works


Finally, only if you still find that your question could not be solved after understanding the documentation and examples provided, then, please start a new thread in this mailing list - never hijack someone else's thread and asking a completely irrelevant question.

when you posting your question, make your question very specific:

"I have read A,B and C, based on the examples in D, E, F, and wrote the below code G, trying to achieve H, I am expecting to see I, but I am getting J, how do I fix this?"

then, there is a chance that someone would be able to help you.


Qianqian


On 12/12/25 19:27, Subham Mukherjee wrote:

You don't often get email from subhammuk...@gmail.com. Learn why this is important

Reply all
Reply to author
Forward
0 new messages