help-octave
[Top][All Lists]
Advanced

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

ASCII till xyz with Octave - problem with cellfun


From: wnint
Subject: ASCII till xyz with Octave - problem with cellfun
Date: Sat, 16 Mar 2013 00:29:19 -0700 (PDT)

Hi, I'm trying to do a conversion from ASCII to xyz coordinates. Found a
MATLAB program that solves this:

http://www.mathworks.com/matlabcentral/fileexchange/21785-ascii2xyz

The program works fine in MATLAB, but I would like to use Octave instead.
When trying the same program in Octave I run into problems. I think the
problem is in the part of the code I've posted below. I'm using version
3.4.3. Can any body see what the problem might be?

*Code:
*
%vector of x, y, and z positions

xv=(hdr{3,2}:hdr{5,2}:hdr{3,2}+...
((hdr{1,2}-1)*hdr{5,2}))+offset;
yv=(fliplr(hdr{4,2}:hdr{5,2}:hdr{4,2}+...
((hdr{2,2}-1)*hdr{5,2})))+offset;

xvec=repmat(xv,[1 hdr{2,2}])';
yvec=cell2mat(cellfun(@(x)(repmat(x,[hdr{1,2} 1])),... <-------* Problem
according to Octave*
num2cell(yv),'uni',0));

%read data
zvec=fscanf(fid,'%f',hdr{1,2}*hdr{2,2});

fclose(fid);

%get rid of values with no data
xyz=[xvec(zvec~=hdr{6,2}),...
yvec(zvec~=hdr{6,2}),...
zvec(zvec~=hdr{6,2})];

*Error message:
*
error: cellfun: unrecognized parameter uni
error: evaluating argument list element number 1
error: called from:
error: C:\...\program.m at line ...


Grateful for any suggestions!



--
View this message in context: 
http://octave.1599824.n4.nabble.com/ASCII-till-xyz-with-Octave-problem-with-cellfun-tp4650842.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

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