PLEASE HELP HELP IT IS URGENTTTTT

PLEASE HELP HELP IT IS URGENTTTTT

Post by ToT » Sat, 27 Feb 1999 04:00:00



I HAVE TO SUBMIT A MATLAB ASSIGNMENT AND I DON'T KNOW HOW TO DISPLAY ON THE
SAME LINE A STRING AND A CERTAIN ELEMEMNT OF A MATRIX ????????
DISP FUNCTION IS NOT THE SOLUTION
 
 
 

PLEASE HELP HELP IT IS URGENTTTTT

Post by Amanda Galtma » Sat, 27 Feb 1999 04:00:00


Are you sure that DISP can't address your problem? Try this-

? a=[1 2 3];
? disp(['The first element of a is ',num2str(a(1))])
The first element of a is 1

Hope this helps,
Amanda


> I HAVE TO SUBMIT A MATLAB ASSIGNMENT AND I DON'T KNOW HOW TO DISPLAY ON THE
> SAME LINE A STRING AND A CERTAIN ELEMEMNT OF A MATRIX ????????
> DISP FUNCTION IS NOT THE SOLUTION


 
 
 

PLEASE HELP HELP IT IS URGENTTTTT

Post by Stan Pawlukiewic » Sat, 27 Feb 1999 04:00:00



> I HAVE TO SUBMIT A MATLAB ASSIGNMENT AND I DON'T KNOW HOW TO DISPLAY ON THE
> SAME LINE A STRING AND A CERTAIN ELEMEMNT OF A MATRIX ????????
> DISP FUNCTION IS NOT THE SOLUTION

fprintf(1,'%g \t %s \n',R(i,j),'text');

  stanp.vcf
< 1K Download
 
 
 

PLEASE HELP HELP IT IS URGENTTTTT

Post by Paul Skoczyla » Sat, 27 Feb 1999 04:00:00



> I HAVE TO SUBMIT A MATLAB ASSIGNMENT AND I DON'T KNOW HOW TO DISPLAY ON THE
> SAME LINE A STRING AND A CERTAIN ELEMEMNT OF A MATRIX ????????
> DISP FUNCTION IS NOT THE SOLUTION

Why are you SHOUTING?

Try looking up fprintf in the online help.

A='abcdefg';
b=[1 2 3];
fprintf('hello %s %g\n',A,b(1))

%gives output:
hello abcdefg 1

-Paul