Error in publishing script

3 ビュー (過去 30 日間)
Harry Spratt
Harry Spratt 2020 年 4 月 12 日
回答済み: Kaustav Bhattacharya 2020 年 12 月 22 日
I obtain this error when publishing my script:
  1. Error using input - Cannot call INPUT from EVALC.
  2. Error in OpticalFunction (line 1) - startw = input('Enter starting wavelength: ');
I've seen that i can indeed publish my script my not evaluating the code as such
publish('myScript.m','evalCode',false)
however i do want the figures in my script to be published as well. Is there anyway around it such as running the script in certain sections.
Also relavent to the publish function, is it meant to publish the contents page:
Table of Contents
Setting Up Motor
Anaylsis of Indirect Band Gap (GaP)
Anaylsis of Indirect Band Gap (GaP)
Optical Function
as it doesn't. Any help is much appreicated

回答 (1 件)

Kaustav Bhattacharya
Kaustav Bhattacharya 2020 年 12 月 22 日
The ability to use "input" function as an argument in "evalc" for execution is not available in MATLAB. Publishing a MATLAB-file involves evaluating the MATLAB file from the MATLAB command prompt, which is carried by the "evalc" command. When you are using "evalc", the functions "diary", "more" and "input" are disabled.
A workaround is to use input dialog boxes to get some control over the script's execution.

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by