필터 지우기
필터 지우기

how to get the name of current running m script

조회 수: 5 (최근 30일)
wenchao zhang
wenchao zhang 2024년 5월 23일
답변: Mirza 2024년 5월 31일
hello, how can i get the name of the script that is running at the moment, thanks.

채택된 답변

Aquatris
Aquatris 2024년 5월 23일
mfilename() function seems to be what you are looking for.
  댓글 수: 1
wenchao zhang
wenchao zhang 2024년 5월 23일
편집: wenchao zhang 2024년 5월 23일
hi Aquatris, thanks for your quick respond, yes that's what i want.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Mirza
Mirza 2024년 5월 31일

#include "engine.h" #include iostream

int main() { // Memulai MATLAB engine Engine *ep = engOpen(nullptr); if (!ep) { std::cerr << "Gagal memulai MATLAB engine" << std::endl; return 1; }

    int bilangan;
    std::cout << "Masukkan sebuah bilangan bulat: ";
    std::cin >> bilangan;
    // Menyimpan bilangan dalam variabel MATLAB
    mxArray *mxBilangan = mxCreateDoubleScalar(static_cast<double>(bilangan));
    engPutVariable(ep, "bilangan", mxBilangan);
    // Menampilkan bilangan di MATLAB
    engEvalString(ep, "disp(['Anda memasukkan bilangan: ', num2str(bilangan)])");
    // Membersihkan variabel dan menutup MATLAB engine
    mxDestroyArray(mxBilangan);
    engClose(ep);
    return 0;
}
if true
  % code
end

카테고리

Help CenterFile Exchange에서 Spline Postprocessing에 대해 자세히 알아보기

태그

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by