User inputs for publish

32 views (last 30 days)
vinay kumar
vinay kumar on 15 Jan 2021
Commented: Hoban Carney on 27 Mar 2022
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")

Answers (1)

Steven Lord
Steven Lord on 15 Jan 2021
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 Comment
Hoban Carney
Hoban Carney on 27 Mar 2022
So you're blaming your customers for what seems like a simple feature to implement. Nice

Sign in to comment.

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Products


Release

R2020b

Community Treasure Hunt

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

Start Hunting!