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

1 visualizzazione (ultimi 30 giorni)
%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 Commento
Dyuman Joshi
Dyuman Joshi il 28 Nov 2023
Firstly, format your code properly.
Secondly, what needs to be analyzed?
Your 2nd question is not clear to me.

Accedi per commentare.

Risposte (1)

Alan Stevens
Alan Stevens il 28 Nov 2023
Modificato: Alan Stevens il 28 Nov 2023
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--')

Categorie

Scopri di più su Testing Frameworks in Help Center e File Exchange

Prodotti


Release

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by