How do I pass the correct string for a function input parameter?
古いコメントを表示
For example, I want to debug a mex file using valgrind in a linux terminal and need to pass in a string using the following command, how should I properly ensure that the function input parameters are of the string type?
I.e. how do I nest string double quotes within a string in matlab function imput arguments?
Using Valgrind
matlab -nojvm -nosplash -r "myMexMatlabFunc(myParams)" -D"valgrind --tool=memcheck --leak-check=yes --log-file=valMatlabLog"
note: myParams is string type params.
I tried adding the following double quotes to the input parameters but it didn't work.
matlab -nojvm -nosplash -r "myMexMatlabFunc(""./imageViewSt.yml"")" -D"valgrind --tool=memcheck --leak-check=yes --log-file=valMatlabLog2"
myMexMatlabFunc(./imageViewSt.yml)
|
Invalid use of operator.
4 件のコメント
Ran Yang
2023 年 4 月 11 日
Use char to specify your file instead.
-r "myMexMatlabFunc('./imageViewSt.yml')"
xingxingcui
2023 年 4 月 11 日
Ran Yang
2023 年 4 月 11 日
Oh, that's a Linux terminal problem. Try using \".
-r "myMexMatlabFunc(\"./imageViewSt.yml\")"
xingxingcui
2023 年 4 月 11 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Startup and Shutdown についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!