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
Show older comments
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 Comments
Kevin Chng
on 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
on 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
on 8 Oct 2018
Kevin Chng
on 8 Oct 2018
Edited: Kevin Chng
on 8 Oct 2018
How about you put function to your script? And delete clear,close,clc
Phan Anh Hoang
on 8 Oct 2018
Kevin Chng
on 8 Oct 2018
function hi()
temp = char('');
while (~ strcmp(temp, 'yes'))
temp = input('Input text here: ','s');
end
end
Phan Anh Hoang
on 8 Oct 2018
Dennis
on 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
on 11 Oct 2018
Accepted Answer
More Answers (1)
KSSV
on 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 Comment
Phan Anh Hoang
on 8 Oct 2018
Categories
Find more on Entering Commands in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!