User inputs for publish

25 visualizaciones (últimos 30 días)
vinay kumar
vinay kumar el 15 de En. de 2021
Comentada: Hoban Carney el 27 de Mzo. de 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")

Respuestas (1)

Steven Lord
Steven Lord el 15 de En. de 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 comentario
Hoban Carney
Hoban Carney el 27 de Mzo. de 2022
So you're blaming your customers for what seems like a simple feature to implement. Nice

Iniciar sesión para comentar.

Categorías

Más información sobre Introduction to Installation and Licensing en Help Center y File Exchange.

Productos


Versión

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by