Borrar filtros
Borrar filtros

スタンドアロンアプリ​ケーションの処理結果​を標準出力に出力する​方法がわかりません

8 visualizaciones (últimos 30 días)
Sosuke Imamura
Sosuke Imamura el 29 de Oct. de 2018
Respondida: Kojiro Saito el 29 de Oct. de 2018
MATLAB Compilerで作成したスタンドアロンアプリケーションをWindowsのコマンドプロンプト上で実行しても処理結果が標準出力に出力されません。disp関数なども使って見ましたが出力されませんでした。 テストに用いたコードは以下のとおりです。
function testadd(x1,x2)
if ischar(x1)
x1 = str2num(x1);
end
if ischar(x1)
x2=str2num(x2);
end
y = x1 + x2
disp(y)

Respuesta aceptada

Kojiro Saito
Kojiro Saito el 29 de Oct. de 2018
アプリケーションコンパイラではデフォルトでは標準出力を表示しないようになっているので、コンパイルする際にランタイム追加設定のパネルを広げ、「Windowsの実行コマンドシェル(コンソール)を表示しない」の チェックを外して コンパイルしてみてください。
以下のように標準出力の内容がコマンドプロンプト上で表示されます。
なお、ここでは
if ischar(x1)
x2=str2num(x2);
end
のところのischar(x1)をischar(x2)に直してコンパイルしています。

Más respuestas (1)

madhan ravi
madhan ravi el 29 de Oct. de 2018
x1='1'
x2='6'
result=testadd(x1,x2)
function y=testadd(x1,x2)
if ischar(x1)
x1 = str2num(x1);
end
if ischar(x2)
x2=str2num(x2);
end
y = x1 + x2;
%disp(y)
end
  1 comentario
madhan ravi
madhan ravi el 29 de Oct. de 2018
The above is an example to illustrate

Iniciar sesión para comentar.

Categorías

Más información sobre スタンドアロン アプリケーション en Help Center y File Exchange.

Productos


Versión

R2017b

Community Treasure Hunt

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

Start Hunting!