can someone help me to analyze this program? How does the flowchart look like?
조회 수: 1 (최근 30일)
이전 댓글 표시
%radiasi benda hitam h=6.626e-34; c=3e8; k=1.38066e-23; lambda = 0:0.1:12; ind=1; for T=1250:150:2000 c1=8*pi*h*c; c2=h*c/k*T; I (ind, :) = (c1./lambda.^5).*(1./(exp(c2./lambda)-1)); ind=ind+1; end h=plot(lambda,I) hold on; grid on; xlabel('wavelength in micrometre') ylabel('power radiated at each wavelength') title ('radiasi benda hitam') [Imax,Iind]= max(I'); h1= plot (lambda(Iind),Imax,'d--')
댓글 수: 1
Dyuman Joshi
2023년 11월 28일
Firstly, format your code properly.
Secondly, what needs to be analyzed?
Your 2nd question is not clear to me.
답변 (1개)
Alan Stevens
2023년 11월 28일
편집: Alan Stevens
2023년 11월 28일
Perhaps this will help:
%radiasi benda hitam
% constants
h=6.626e-34; c=3e8; k=1.38066e-23;
% range of values
lambda = 0:0.1:12;
% Initialise a counter
ind=1;
% loop through values of T from 1250 to 2000 in steps of size 150
for T=1250:150:2000
c1=8*pi*h*c; c2=h*c/k*T; % constants for use in next line
% Construct row number ind of a matrix that has the same number of
% columns as there are elements in lambda
I (ind, :) = (c1./lambda.^5).*(1./(exp(c2./lambda)-1));
ind=ind+1; % increment ind by 1
end
% plot results
plot(lambda,I)
hold on; grid on;
xlabel('wavelength in micrometre')
ylabel('power radiated at each wavelength')
title ('radiasi benda hitam')
[Imax,Iind]= max(I');
plot (lambda(Iind),Imax,'d--')
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Testing Frameworks에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!