I get an error, what's wrong? The 'STRING' input must be either a char row vector or a cell array of char row vector
Afficher commentaires plus anciens
Hi
I tried to build an app that using below code
----
clear
close all
clc
temp = char('');
while (~ strcmp(temp, 'yes'))
temp = input('Input text here: ','s');
end
After using "Application Compiler" to build the App

I ran exe file, the below message display.

I used R2016a, what was wrong? Please advise!
10 commentaires
Kevin Chng
le 8 Oct 2018
I don't have error with R2018b, however, may i ask you that do you have error in running them in MATLAB?
Walter Roberson
le 8 Oct 2018
That appears to be a script. As far as I understand, it is not possible to use the application compiler with a script, only with a function.
Those clear and close and clc are not doing you any good and should be removed for application compiler.
Phan Anh Hoang
le 8 Oct 2018
Kevin Chng
le 8 Oct 2018
Modifié(e) : Kevin Chng
le 8 Oct 2018
How about you put function to your script? And delete clear,close,clc
Phan Anh Hoang
le 8 Oct 2018
Kevin Chng
le 8 Oct 2018
function hi()
temp = char('');
while (~ strcmp(temp, 'yes'))
temp = input('Input text here: ','s');
end
end
Phan Anh Hoang
le 8 Oct 2018
Dennis
le 8 Oct 2018
I don't think this will work with input. The app is supposed to run without Matlab running or even installed. Hence there is no command line.
Where should you enter anything?
Phan Anh Hoang
le 11 Oct 2018
Réponse acceptée
Plus de réponses (1)
KSSV
le 8 Oct 2018
I am not sure, but have a try on this :
close all
clc
temp = cell([],1) ;
temp{1} = char('') ;
count = 1 ;
while (~ strcmp(temp{count}, 'yes'))
count = count+1 ;
temp{count} = input('Input text here: ','s');
end
1 commentaire
Phan Anh Hoang
le 8 Oct 2018
Catégories
En savoir plus sur Entering Commands dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
