Error using ==> sprintf
1 次查看(过去 30 天)
显示 更早的评论
prompt{1}=('Enter your Name :');
prompt{2}='Enter Marks :');
prompt{3}='Enter aggregate :');
name='Student';
z=(inputdlg(prompt{1},name, [1 30]));
x=str2double(inputdlg(prompt{2},name, [1 30]));
y=str2double(inputdlg(prompt{3},name, [1 30]));
a=xlsread('inputdata.xlsx');
Actual_output=a(ismember(a(:,1:2),[x y],'rows'),3);
message = sprintf('The name is: %s \n Marks : %.1f \n Aggregate is : %.1f \n The grade is : %.1f \n ',z,x,y,Actual_output);
uiwait(msgbox(message));
ERROR is
??? Error using ==> sprintf
Function is not defined for 'cell' inputs.
0 个评论
采纳的回答
Azzi Abdelmalek
2013-9-26
Replace z by z{1} (because z is a cell array)
message = sprintf('The name is: %s \n Marks : %.1f \n Aggregate is : %.1f \n The grade is : %.1f \n ',z{1},x,y,Actual_output);
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 NaNs 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!