Path: news.mathworks.com!not-for-mail
From: "Sadik " <sadik.hava@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Matrix dimensions not agree, not rendering mesh. please help
Date: Sun, 8 May 2011 02:48:04 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 15
Message-ID: <iq5094$i6c$1@newscl01ah.mathworks.com>
References: <iq2qr8$mbn$1@newscl01ah.mathworks.com> <iq3vbc$93m$1@newscl01ah.mathworks.com> <iq4pso$51h$1@newscl01ah.mathworks.com> <iq4r9o$7v7$1@newscl01ah.mathworks.com> <iq4rql$92a$1@newscl01ah.mathworks.com>
Reply-To: "Sadik " <sadik.hava@gmail.com>
NNTP-Posting-Host: www-04-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1304822884 18636 172.30.248.35 (8 May 2011 02:48:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 8 May 2011 02:48:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1666517
Xref: news.mathworks.com comp.soft-sys.matlab:725698

Hi Salman,

The problem is with the usage of surf. If you want to make a plot of Z1 vs. Z and T, then Z1 should be the third argument. 

Here is an example that works, but you will need to modify it if it is not doing what you want theoretically.

t=linspace(0,.00000001,200);
z=linspace(0,.0001,200);
s=[1,0,0,0,0,0,0,0,0];
[t,y]=ode45(@fname,t,s);
[T,Z] = meshgrid(t,z);
Z1=i*21445.*repmat(y(:,3),[1 size(Z,2)]).*Z-21445*(T-Z);
surf(T,Z,abs(Z1))

Best.