Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Computing product of cell
Replies: 1   Last Post: Mar 11, 2014 4:53 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Zulfiquar

Posts: 1
Registered: 3/11/14
Computing product of cell
Posted: Mar 11, 2014 4:04 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

n=5;
L=8;
c=cell((n+1)^2,1);
xprod = cell((n+1)^2,(n+1)^2);
h=ones(size(c));
C=zeros((n+1)^2,L*L);
wayC=zeros(2,L*L);
w = 0:pi/(L-1):pi;
i=0;
for k = 0:n;
for j=0:n;
i=i+1;
c{i} = @(w1,w2)cos(k.*w2).*cos(j*w1);
end
end
for i=0:n;
xprod{i+1} = @(w1,w2)(c{i+1}.*c');
end
for k=1:L;
C(:,(k-1)*L+1:k*L)=cell2mat(cellfun(@(dc) dc(w(k),w),xprod,'Uniformoutput',false));
end

Hello,
I wanted to run the above code. But I got an error message which I could not fix. Here is the error message I am getting in MATLAB

Undefined function 'times' for input arguments of type 'function_handle'.

Error in @(w1,w2)(c{i+1}.*c')


Error in @(dc)dc(w(k),w)


Error in gen_BigC (line 24)
C(:,(k-1)*L+1:k*L)=cell2mat(cellfun(@(dc)
dc(w(k),w),xprod,'Uniformoutput',false));

Can anyone help me how to fix the problem? Thank you



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.