필터 지우기
필터 지우기

Error using ==> sprintf

조회 수: 5 (최근 30일)
Dimple
Dimple 2013년 9월 26일
댓글: Dimple 2013년 9월 26일
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.

채택된 답변

Azzi Abdelmalek
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);
  댓글 수: 1
Dimple
Dimple 2013년 9월 26일
Thank You.....

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 NaNs에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by