User inputs for publish

26 次查看(过去 30 天)
vinay kumar
vinay kumar 2021-1-15
do we have any command for successfull execuation of the publish for the user inputs, when i try to execuate and publish the code with input function it pop up an error as
Error using input Cannot call INPUT from EVALC. Error in act2 (line 20) line = input("select the line which you want to calculate, 1 for twowire, 2 for coaxial, 3 for parallelplate")

回答(1 个)

Steven Lord
Steven Lord 2021-1-15
To me, publishing is intended as a non-interactive activity. You should be able to start the publishing process, go get a cup of your favorite beverage, and come back to find the publishing process complete.
Calling input is absolutely an interactive activity.
I would extract the interactive section of your code that calls input into an interface function and turn the computational section of your code into a computational function that accepts data either from the interface function or directly from the user calling it. Then call publish with the 'codeToEvaluate' name-value pair argument containing a call to your computational function with the appropriate inputs. If you want to have a user interact with the computational function they could do so directly or they could call your interface function.
If you're publishing via the Toolstrip rather than executing the publish function, click the downward pointing triangle under the Publish icon on the Publish tab of the Toolstrip in the Editor. You can specify the code you want to run when you publish.
  1 个评论
Hoban Carney
Hoban Carney 2022-3-27
So you're blaming your customers for what seems like a simple feature to implement. Nice

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by