help-octave
[Top][All Lists]
Advanced

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

odd problem with addpath


From: giolu
Subject: odd problem with addpath
Date: Wed, 22 Aug 2007 21:15:43 +0200
User-agent: Internet Messaging Program (IMP) 3.2.8

Hello to all..
I'm continuing struggling with this strange behaviour

I've followed also other instruction with addpath. The command seems to like
some of my matlab fuction but skipe others here an example
Can someone please help :( ? Any hint very very appreciated


there's the results.. both nipals and matomod are two mfiles

there' the matmod
files and the error I get...
ANY IDEA ?
(sorry for posting matlab)

----% This program computes a model matrix starting from an
% experimental matrix. The experimental matrix is x.
% Vector coeff stores the termes of the model
function [x,coeff]=matmod(x)
[r,c]=size(x);
coeff=zeros(1,c+c*(c-1)/2+1);
z=0;
a=c;
ct=input('Cross-terms (y/n) ? ','s');
if ct=='y'
  act=input('All cross-terms (y/n) ? ','s');
  if act=='n'
    for j1=1:c-1
      for j2=j1+1:c
        z=z+1;
        sct=input(['Cross-term between ',int2str(j1),' and ',int2str(j2),' (y/n)
? '],'s');
        if sct=='y'
          coeff(1,z)=coeff(1,z)+1;
          a=a+1;
          x(:,a)=x(:,j1).*x(:,j2);
        end
      end
    end
  end
  if act=='y'
    coeff(1,[1:c*(c-1)/2])=coeff(1,[1:c*(c-1)/2])+1;
    for j1=1:c-1
      for j2=j1+1:c
        a=a+1;
        x(:,a)=x(:,j1).*x(:,j2);
      end
    end
  end
end
ct=input('Square terms (y/n) ? ','s');
if ct=='y'
  act=input('All square terms (y/n) ? ','s');
  if act=='n'
    z=c*(c-1)/2;
    for j1=1:c
      z=z+1;
      sct=input(['Square term for variable ',int2str(j1),' (y/n) ? '],'s');
      if sct=='y'
        coeff(1,z)=coeff(1,z)+1;
        a=a+1;
        x(:,a)=x(:,j1).^2;
      end
    end
  end
  if act=='y'
    coeff(1,[c*(c-1)/2+1:c+c*(c-1)/2])=coeff(1,[c*(c-1)/2+1:c+c*(c-1)/2])+1;
    for j1=1:c
      a=a+1;
      x(:,a)=x(:,j1).^2;
    end
  end
end
ct=input('Constant term? (y/n) ','s');
if ct=='y'
  coeff(1,c+c*(c-1)/2+1)=1;
  a=a+1;
  x=[ones(r,1) x];
end
------


------------------------------
octave.exe:12> help nipals
NIPALS (algorithm in Brereton)
2 output files are produced: the first one with loadings,
the second one with scores
e:/ofiles\nipals.m

Additional help for built-in functions and operators is
available in the on-line version of the manual.  Use the command
`doc <topic>' to search the manual index.

Help and information about Octave is also available on the WWW
at http://www.octave.org and via the address@hidden
mailing list.
octave.exe:13> help MATMOD

help: `MATMOD' not found
Additional help for built-in functions and operators is
available in the on-line version of the manual.  Use the command
`doc <topic>' to search the manual index.

Help and information about Octave is also available on the WWW
at http://www.octave.org and via the address@hidden
mailing list.
octave.exe:14>


reply via email to

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