help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Matlab function "mprint"


From: Olli Saarela
Subject: Re: Matlab function "mprint"
Date: Tue, 25 Sep 2007 11:26:35 +0300
User-agent: Thunderbird 2.0.0.6 (Windows/20070728)

r=[1 2 3]';
fprintf(1,'\n Critical values \n');
fprintf(1,'***********************************************\n');
  infod.cnames=strvcat('1%','5%','10%');
  infod.fmt = '%6.3f';
mprint(r,infod);
fprintf(1,'***********************************************\n');

I obtained from Octave 2.9.13  the following messages:

error: wrong # cnames in mprint

This error message tries to tell that the number of column names in
infod doesn't match the number of columns in data matrix r. What you
probably want is

    r=[1 2 3];

without the transpose operator ('). This defines a data set with a
single observation (row) of three variables (columns).

Making that change, however, gets you to the next issue. Version checks near lines 250 & 269 in mprint.m are Matlab-specific and obsolete. Just comment out the unnecessary lines in both version checks. For example:

    % find version #;
    %  [version,junk] = version; vers = str2num(version);
    %   if vers == 5.2
       fprintf(fid,sfmtv{i},strjust(cnames(i,:),'right'));
    %   else
    %   fprintf(fid,sfmtv{i},strjust(cnames(i,:)));
    %   end;

With these changes, your example works for me.

Regards,
  Olli



reply via email to

[Prev in Thread] Current Thread [Next in Thread]