can someone help me to analyze this program? How does the flowchart look like?

조회 수: 1 (최근 30일)
Aul Wan
Aul Wan 2023년 11월 28일
편집: Alan Stevens 2023년 11월 28일
%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
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
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--')

카테고리

Help CenterFile Exchange에서 Testing Frameworks에 대해 자세히 알아보기

태그

제품


릴리스

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by