Effacer les filtres
Effacer les filtres

Using 'disp' function with variables

29 vues (au cours des 30 derniers jours)
Harry
Harry le 29 Août 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);

Réponse acceptée

ES
ES le 29 Août 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!

Plus de réponses (1)

chaibrassou mohamed salah
chaibrassou mohamed salah le 7 Fév 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)

Catégories

En savoir plus sur Mathematics dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by