User inputs for publish
26 次查看(过去 30 天)
显示 更早的评论
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")
0 个评论
回答(1 个)
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
2022-3-27
So you're blaming your customers for what seems like a simple feature to implement. Nice
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!