Using 'disp' function with variables

102 visualizaciones (últimos 30 días)
Harry
Harry el 29 de Ag. de 2013
Respondida: chaibrassou mohamed salah el 7 de Feb. de 2021
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);

Respuesta aceptada

ES
ES el 29 de Ag. de 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!

Más respuestas (1)

chaibrassou mohamed salah
chaibrassou mohamed salah el 7 de Feb. de 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)

Categorías

Más información sobre Mathematics en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by