Using 'disp' function with variables

46 Ansichten (letzte 30 Tage)
Harry
Harry am 29 Aug. 2013
I have a line of code which is giving me some trouble and I cant understand why:
disp('There is an ice rule violation at: (', xd, ',', yd, ')')
where xd and yd are variables that are generated beforehand and I simply want it to display:
There is an ice rule violation at: (7,8)
where 7 and 8 are examples of xd and yd respectively and the program gives me an error:
Error using disp
Too many input arguments.
Error in New_correlation_values_3_2/checkvertex (line 145)
disp('There is an ice rule violation at: (', xd, ',', yd, ')')
Error in New_correlation_values_3_2 (line 45)
[N,avg] = checkvertex(xd,yd,M,N,ic,jc);

Akzeptierte Antwort

ES
ES am 29 Aug. 2013
disp() takes only one argument.
To accomplish what you need, do disp(['There is an ice rule violation at: (', num2str(xd), ',', num2str(yd), ')'])
Thanks!

Weitere Antworten (1)

chaibrassou mohamed salah
chaibrassou mohamed salah am 7 Feb. 2021
X= input (' veuillez introduire votre numéro d inscription = ','s');
Y= input (' veuillez introduire votre Nom = ','s');
Z= input (' veuillez introduire votre Prénom = ','s');
A= input (' veillez introduire votre Date de naissance sous forme de nombre entier Année = ','s');
B= input (' mois = ','s');
C =input ('jour= ','s');
E=input (' Quel est votre Groupe =','s');
F = input('Quelle est votre Année universitaire sous forme debut de l annne/fin de l Année/n debut de l Année =','s');
G=input ('fin de l Année=','s');
disp('numéro d inscription:',X,'\n','Nom:',Y,'\n',' Prénom :',Z,'\n','Date de naissance ',A,'/',B,'/',C,'\n','Groupe : ',E,'\n',' Année universitaire : ',F,'/',G)

Kategorien

Mehr zu Signal Processing Toolbox finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by