필터 지우기
필터 지우기

How to display values from MATLAB standalone windows deployment executable?

조회 수: 20 (최근 30일)
Surjya padhi
Surjya padhi 2014년 6월 25일
답변: Kilsu Kim 2023년 5월 9일
I have created a matlab script file as follows
function MyWorld
var1 = [9 10];
var2 = 5;
disp(var2)
disp(var3)
It works and displays value of var1 and var2 in MATLAB terminal. Now for deployment I choose the windows standalone exe. I got the .exe file and run it on windows command terminal, but did not get any output.
Please suggest anywhere I am wrong...

답변 (3개)

Martin Lechner
Martin Lechner 2020년 10월 8일
I had the same problem but I found a solution to redirect the output to a file
MyWorld.exe >output.log
It's also possible to redirect the standard error to a file
MyWorld.exe >output.log 2>error.log

Ben11
Ben11 2014년 6월 25일
My guess would be that the "disp" command is only used to display stuff in the command window in the Matlab environment; for a standalone application you might want to display a message or something like this. Or you could build a simple GUI which would display your variables.
  댓글 수: 2
Surjya padhi
Surjya padhi 2014년 6월 26일
편집: Surjya padhi 2014년 6월 26일
Instead of "disp", i used only the variable name without semicolon.
var1
var2
Still no luck
Ben11
Ben11 2014년 6월 26일
편집: Ben11 2014년 6월 26일
What if you use this:
function MyWorld
var1 = [9 10];
var2 = 5;
Message = sprintf('My variables are var1: [%i %i] and var2: %i \n',var1(1),var1(2),var2);
msgbox(Message)

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


Kilsu Kim
Kilsu Kim 2023년 5월 9일
This is an old question, but I hope the following documentation will help you.
See "Customize an Application/Additional Runtime Settings":
You can see the code output by unchecking "Do not display the Windows Command Shell (console) for execution" when packaging the file.
For code you want to see output, you need to either remove the semicolon (;) or use the "disp" function.

카테고리

Help CenterFile Exchange에서 Adding custom doc에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by