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
이전 댓글 표시
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
Kevin Chng
2018년 10월 8일
I don't have error with R2018b, however, may i ask you that do you have error in running them in MATLAB?
Walter Roberson
2018년 10월 8일
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
2018년 10월 8일
Kevin Chng
2018년 10월 8일
편집: Kevin Chng
2018년 10월 8일
How about you put function to your script? And delete clear,close,clc
Phan Anh Hoang
2018년 10월 8일
Kevin Chng
2018년 10월 8일
function hi()
temp = char('');
while (~ strcmp(temp, 'yes'))
temp = input('Input text here: ','s');
end
end
Phan Anh Hoang
2018년 10월 8일
Dennis
2018년 10월 8일
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
2018년 10월 11일
채택된 답변
추가 답변 (1개)
KSSV
2018년 10월 8일
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
카테고리
도움말 센터 및 File Exchange에서 Characters and Strings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
