Matlab error in Windows prompt

1 回表示 (過去 30 日間)
Mustafa Al-tekreeti
Mustafa Al-tekreeti 2018 年 1 月 7 日
編集済み: Walter Roberson 2018 年 1 月 7 日
I am trying to run a matlab function from windows command line using the following:
matlab -r "UDP_WiFi_1 1500 19.3 7 12000000;exit"
the function is called UDP_WiFi_1 and it takes 4 scalar parameters. This function runs fine without any error if called in matlab command line. However, if it is called from windows command line, it opens matlab and then gives the following error:
Error using /
Matrix dimensions must agree
It is weird because all the parameters are scalar and I don't have any matrix, any help is highly appreciated!

採用された回答

Steven Lord
Steven Lord 2018 年 1 月 7 日
"It is weird because all the parameters are scalar"
Not the way you're calling your function. You're calling it using command syntax which means the first input to your function is '1500' (a 1-by-4 char vector) rather than 1500 (a 1-by-1 double scalar.) You want to call it using function syntax instead:
matlab -r "UDP_WiFi_1(1500, 19.3, 7, 12000000);exit"
  1 件のコメント
Mustafa Al-tekreeti
Mustafa Al-tekreeti 2018 年 1 月 7 日
Thank you very much Steven, it solves the problem

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by