how to get the name of current running m script
조회 수: 5 (최근 30일)
이전 댓글 표시
hello, how can i get the name of the script that is running at the moment, thanks.
댓글 수: 0
채택된 답변
추가 답변 (1개)
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
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!