Path: news.mathworks.com!newsfeed-00.mathworks.com!solaris.cc.vt.edu!news.vt.edu!news.glorb.com!postnews.google.com!q11g2000vbq.googlegroups.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: ERROR MESSAGE - MRDIVIDE, MATRIX DIMENSIONS MUST AGREE
Date: Mon, 2 Jan 2012 00:01:53 -0800 (PST)
Organization: http://groups.google.com
Lines: 66
Message-ID: <9f098290-3bcf-4c34-b72e-be16374be252@q11g2000vbq.googlegroups.com>
References: <jdrk6o$15u$1@newscl01ah.mathworks.com>
NNTP-Posting-Host: 192.102.151.35
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1325491415 27486 127.0.0.1 (2 Jan 2012 08:03:35 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Mon, 2 Jan 2012 08:03:35 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: q11g2000vbq.googlegroups.com; posting-host=192.102.151.35; posting-account=X3eThQoAAACh5vOSip_rNRzKAq7k0jPW
User-Agent: G2/1.0
X-Google-Web-Client: true
X-Google-Header-Order: ARLUEHNKC
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1;
 Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR
 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E),gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:753546

On 2 Jan., 07:52, "asri " <achi_a...@yahoo.com> wrote:
> hi, i'm beginner using matlab. i have problem with my script:
>
> clear all;close all;clc
> %parameter
> nx=301;ny=161;
> dlon=0.05;dlat=0.05;
> lat=-10:dlat:-2;
> lon=100:dlon:115;
> h=6.626068e34;
> c=2.997925e8;
> k=1.38e-23;
> lamda=3.75e-6;
> lo=2395555.55555556;
> u=0.9;
>
> %load data tbb
> fid1=fopen('IR1_all.dat','rb');
> for t=1:1
>     tmp=fread(fid1,[nx,ny],'float32');
>     tbb1(:,:,t)=tmp;
>     clear tmp
> end
> fid2=fopen('IR4_all.dat','rb');
> for t=1:1
>     tmp=fread(fid2,[nx,ny],'float32');
>     tbb4(:,:,t)=tmp;
>     clear tmp;
> end
> rad1=(2*h*c^2)/((lamda^5)*(exp(((h*c)/(lamda*k*tbb1)))-1));
>
> for j0=1:ny-1
>     for i0=1:nx-1
>         for t=1:1
>            rad1=(2.*h*c^2)/((lamda^5)*(exp(((h*c)/(lamda*k*tbb1)))-1.));
>         end
>     end
> end
>
> this is the error message:
> ??? Error using ==> mrdivide
> Matrix dimensions must agree.
>
> Error in ==> itung_ref_coba at 28
> rad1=(2*h*c^2)/((lamda^5)*(exp(((h*c)/(lamda*k*tbb1)))-1)

You mean

for j0=1:ny-1
     for i0=1:nx-1
         for t=1:1
            rad1(i0,j0,t)=(2.*h*c^2)/((lamda^5)*(exp(((h*c)/
(lamda*k*tbb1(i0,j0,t))))-1.));
         end
     end
end

or shorter

rad1=(2.*h*c^2)/((lamda^5)*(exp(((h*c)./(lamda*k*tbb1)))-1.));

??

Best wishes
Torsten.