MATLAB Command Window

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

23/4/23 10:28 AM MATLAB Command Window 1 of 4

>> % black body radiation curve


>> h = 6.623e-34;
>> c=3e0;
>> k=1.3866e-23

k =

1.3866e-23

>> k=1.3866e-23

k =

1.3866e-23

>> k=1.3866e-23;
>> lamda(0:0.1:12);
Undefined function 'lamda' for input arguments of type 'double'.

>> lamda(0:0.1:12;
lamda(0:0.1:12;
|
Error: Unbalanced or unexpected parenthesis or bracket.

>> lambda(0:0.1:12);
Undefined function 'lambda' for input arguments of type 'double'.

>> ind=i;
>> for T=1250:150:2000
c1=8*pi*h*c;
c2=h*c/k*T;
I(ind,i)=(c1./lambda.^5).*(1./(exp(c2./lambda)-1));
ind=ind+1;
end
Undefined function or variable 'lambda'.

>> h=plot(lambda,I)
Undefined function or variable 'lambda'.

>> hold on;


>> grid on
>> xlabel(wavelength in micrometer')
xlabel(wavelength in micrometer')
|
Error: Unexpected MATLAB expression.

>> h = 6.623e-34;
>> h = 6.623e-34; % planck's constant
>> c=3e0;
>> k=1.3866e-23; % boltzman constant(j/k)
>> lamda(0:0.1:12); wavelength in micrometer
23/4/23 10:28 AM MATLAB Command Window 2 of 4

Undefined function 'lamda' for input arguments of type 'double'.

>> lamda(0:0.1:12); %wavelength in micrometer


Undefined function 'lamda' for input arguments of type 'double'.

>> lambda(0:0.1:12); %wavelength in micrometer


Undefined function 'lambda' for input arguments of type 'double'.

>> ind=i;
for T=1250:150:2000
c1=8*pi*h*c;
c2=h*c/k*T;
I(ind,i)=(c1./lambda.^5).*(1./(exp(c2./lambda)-1));
ind=ind+1;
end
Undefined function or variable 'lambda'.

>> h=plot(lambda,I)
Undefined function or variable 'lambda'.

>> hold on;


grid on
xlabel(wavelength in micrometer')
xlabel(wavelength in micrometer')
|
Error: Unexpected MATLAB expression.

>> xlabel('wavelength in micrometer')


>> ylabel('power radiated at each wavelength')
>> title('black body radiation curve at various temperature');
>> [Imax,Ind]=max(I');% findout maximum of all curve and their indexes
Undefined function or variable 'I'.

Did you mean:


>> [Imax,Ind]=max(i');
>> hI=plot(lambda(Iind), Imax,'d--')
Undefined function or variable 'Iind'.

>> hI=plot(lambda(Ind), Imax,'d--')


Undefined function 'lambda' for input arguments of type 'double'.

>> lam(0:0.1:12); %wavelength in micrometer


Warning: Integer operands are required for colon operator when used as index
Subscript indices must either be real positive integers or logicals.

>> lam(0,0.1,12); %wavelength in micrometer


Attempted to access lam(0,0.1,12); index must be a positive integer or logical.

>> lam(.01,0.1,12); %wavelength in micrometer


Attempted to access lam(0.01,0.1,12); index must be a positive integer or logical.
23/4/23 10:28 AM MATLAB Command Window 3 of 4

>> lam(0.1,5,12); %wavelength in micrometer


Attempted to access lam(0.1,5,12); index must be a positive integer or logical.

>> lam(0,0.1,12); %wavelength in micrometer


Attempted to access lam(0,0.1,12); index must be a positive integer or logical.

>> ind=i;
for T=1250:150:2000
c1=8*pi*h*c;
c2=h*c/k*T;
I(ind,i)=(c1./lam.^5).*(1./(exp(c2./lambda)-1));
ind=ind+1;
end
Undefined function or variable 'lambda'.

>> ind=i;
for T=1250:150:2000
c1=8*pi*h*c;
c2=h*c/k*T;
I(ind,i)=(c1./lambda.^5).*(1./(exp(c2./lam)-1));
ind=ind+1;
end
Undefined function or variable 'lambda'.

>> ind=i;
for T=1250:150:2000
c1=8*pi*h*c;
c2=h*c/k*T;
I(ind,i)=(c1./lam.^5).*(1./(exp(c2./lam)-1));
ind=ind+1;
end
Subscripted assignment dimension mismatch.

>> ind=i;
for T=1250:150:2000
c1=8*pi*h*c;
c2=h*c/k*T;
I(ind,i)=(c1./lam.^5).*(1./(exp(c2./lam)-1));
ind=ind+1;
end
Subscripted assignment dimension mismatch.

>>
>> h=plot(lamb,I)
lamb.m called incorrectly
Error in lamb (line 14)
if nargin<9, disp(' lamb.m called incorrectly')

Output argument "bnds" (and maybe others) not assigned during call to "C:\Program
Files\MATLAB\R2014a\toolbox\robust\rctobsolete\mutools\subs\lamb.m>lamb".
23/4/23 10:28 AM MATLAB Command Window 4 of 4

>> xlabel('wavelength in micrometer')


ylabel('power radiated at each wavelength')
title('black body radiation curve at various temperature');
[Imax,Ind]=max(I');% findout maximum of all curve and their indexes
Undefined function or variable 'I'.

Did you mean:


>> [Imax,Ind]=max(i');
>> hI=plot(lamInd), Imax,'d--')
hI=plot(lamInd), Imax,'d--')
|
Error: Unbalanced or unexpected parenthesis or bracket.

>> hI=plot(lambda(Ind), Imax,'d--')


Undefined function 'lambda' for input arguments of type 'double'.

>> hI=plot(lam(Ind), Imax,'d--')

hI =

177.0011

>>

You might also like