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
Mostrar comentarios más antiguos
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 comentarios
Kevin Chng
el 8 de Oct. de 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
el 8 de Oct. de 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
el 8 de Oct. de 2018
Kevin Chng
el 8 de Oct. de 2018
Editada: Kevin Chng
el 8 de Oct. de 2018
How about you put function to your script? And delete clear,close,clc
Phan Anh Hoang
el 8 de Oct. de 2018
Kevin Chng
el 8 de Oct. de 2018
function hi()
temp = char('');
while (~ strcmp(temp, 'yes'))
temp = input('Input text here: ','s');
end
end
Phan Anh Hoang
el 8 de Oct. de 2018
Dennis
el 8 de Oct. de 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
el 11 de Oct. de 2018
Respuesta aceptada
Más respuestas (1)
KSSV
el 8 de Oct. de 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 comentario
Phan Anh Hoang
el 8 de Oct. de 2018
Categorías
Más información sobre Entering Commands en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
