hi Sunny,
you can't use the mmc command line in matlab. it doesn't work that way.
to use mmclab, you should run
help mmclab
in matlab and read the input/output format of the mmclab command.
you should also try the sample code at the end of the help info,
or open and read each of the sample scripts under
https://github.com/fangq/mmc/tree/master/mmclab/example
Qianqian
--
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/CAOvA73SYVa%3DJ5_PKK4_w%3DjKsEoT29EWnKuq8mRViZCEMVuhMGg%40mail.gmail.com.
I am not exactly sure what you wanted - usually you need a .json file when running mmc binary in a terminal instead of in matlab. if you use matlab, you just define the cfg structure, as shown by all the examples you saw, you do not need the json file.
I guess my question is: why you want to run mmc binary inside
matlab? why can't you run it in a terminal window?
Hello Dr. Fang,
Many thanks for your reply. I checked the examples one by one but did not find any related to using .json file as input in MMC.
All the examples are like the following screenshot, [xx, xx]=mmclab(cfgs)
Do you have any other suggestions? Highly appreciated.
Best wishes,Sunny
Qianqian Fang <q.f...@neu.edu> 于2024年6月25日周二 04:55写道:
hi Sunny,
mmc binary and mmclab can both handle layered medium or irragular/complex domains.
mmclab cfg data structure and a MMC JSON based files can also define both types of domains. There is no connection between JSON and irregular geometry.
when you say a .json file, do you mean an mmc input JSON file for
the mmc command-line? like this one:
https://github.com/fangq/mmc/blob/master/examples/skinvessel/dmmc_skinvessel.json
if you already have constructed such input file - then you should run "mmc -f input.json" in a terminal like in this sample script
https://github.com/fangq/mmc/blob/master/examples/skinvessel/run_dmmc.sh
we currently only provide the mmc2json function to convert an
mmclab cfg struct to an mmc JSON input file, but not vice versa
https://github.com/fangq/mmc/blob/master/mmclab/mmc2json.m
hope you can clarify this a bit more
Qianqian
hi Sunny,
hi Sunny,
on windows, if you want to run a bash/sh script (with suffix .sh), you must install and start a terminal program that uses bash as the default shell. you can pick any one of the following choices:
1. install Git for windows (https://gitforwindows.org/) and start
a git bash terminal
2. install msys2 (https://www.msys2.org/) and start the msys2 terminal
3. install cygwin64 (https://www.cygwin.com/), and run the
cygwin64 terminal
4. install WSL2
(https://www.windowscentral.com/how-install-wsl2-windows-10),
install a Linux distribution, and start a terminal from the
installed Linux
as a matter of fact, the .sh script is just a text file, if you
open it with a text editor (such as notepad/pspad), you can see
there is just one simple command starting with mmc. running that
command does not necessarily require bash. you can directly copy
paste this command in a DOS terminal (cmd) or power-shell terminal
(PowerShell), cd to the directory where you want to run it, and
run the command in DOS or powershell. if either mmc or the input
file is not found, please make sure you type the correct full path
for both.
again, as someone presumably just start using mmc, unfortunately
you picked the most difficult path by trying to run 1) mmc in the
command line and 2) run a bash script on windows. I still do not
understand why you can not use mmclab with matlab, which is a lot
more beginner-friendly.
Qianqian
Hello Dr Fang,
I hope you are doing well!
I was trying to run a .sh file for my simulations, and tried the following three ways:
#1. In the Matlab, I used this command: --- failed
#2. In the example folder, right-click on the run_test.sh-->Git for Windows, and the pop-out window crashes (shows up and disappears fast as the attached video shows). ---failed
In the previous email, you mentioned terminal, do you mean the Window PowerShell?could you please advise?
Many thanks for your help.
Best,Sunny
Qianqian Fang <q.f...@neu.edu> 于2024年6月29日周六 04:18写道:
hi Sunny,
just a kind reminder: please do not send large attachment files,
such as the video recording you attached previously, to either
mcx-users or mmc-users mailing list.
there are around 400 subscribers to these mailing lists, sending
large attachments creates burdens to many of the subscribers.
Please place anything larger than 1-2 MB to a cloud storage, such
as dropbox or google drive, and only share the link with the
email.
why you used mcxlab example in the screenshot if you were referring to mmclab?
have you checked out the examples folder in mmclab?
Dear Dr Fang,Thank you for your time and patience!
I realized that I had been using mcxlab for layered medium in my previous study. You remind me that there is mmclab, I have checked the published examples, some use mcxlab and some use mmclab. Gently ask what is the difference between them?
please read our papers. they have all the answers
Currently, I am trying to build a cfg structure for my simulation on the irregular medium.
To ensure that the source is in mesh, I have written code like this:%%% ensure source is in mesh %%%%%%%%%%%cfg.increment = 0.01;cfg.stretch = 0;cfg.srcpos = source;cfg.srcdir = source_unit_vec;cfg.eid = tsearchn(cfg.node(:,1:3),cfg.elem(:,1:4),1:4));while isnan(cfg.eid)cfg.stretch = cfg.stretch + cfg.increment;cfg.eid = tsearchn(cfg.node(:,1:3),cfg.elem(:,1:4),cfg.srcpos+cfg.stretch*cfg.srcdir);endcfg.srcpos = cfg.srcpos + cfg.stretch*cfg.srcdir;I wonder how can I call the MATLAB function tsearchn in the cfg structure?
please follow our examples. you do not need to define cfg.eid, it will be computed automatically inside mmclab