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
Ältere Kommentare anzeigen
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 Kommentare
Kevin Chng
am 8 Okt. 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
am 8 Okt. 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
am 8 Okt. 2018
Kevin Chng
am 8 Okt. 2018
Bearbeitet: Kevin Chng
am 8 Okt. 2018
How about you put function to your script? And delete clear,close,clc
Phan Anh Hoang
am 8 Okt. 2018
Kevin Chng
am 8 Okt. 2018
function hi()
temp = char('');
while (~ strcmp(temp, 'yes'))
temp = input('Input text here: ','s');
end
end
Phan Anh Hoang
am 8 Okt. 2018
Dennis
am 8 Okt. 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
am 11 Okt. 2018
Akzeptierte Antwort
Weitere Antworten (1)
KSSV
am 8 Okt. 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 Kommentar
Phan Anh Hoang
am 8 Okt. 2018
Kategorien
Mehr zu Characters and Strings finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
