Using all values in a matrix as inputs for a function.
显示 更早的评论
I am new to Matlab and programming and am hoping that someone can help me out or point me in the right direction with an issue I have run into.
I have a 240x320 matrix (tempK) derived from a thermal image. Each cell in the matrix contains the temperature value of the cosponsoring pixel from the thermal image. I have defined the following function:
function out=Planck_radconvers(lambda_,tempK)
C1 = 1.19e-16;
C2 = 1.44e-2;
out=C1/(lambda_^5*(exp(C2/(lambda_*tempK))-1))*1e-6;
end
I then tried to use this function by applying the following:
rad=planck(10.25e-6,tempK)
The issue is that I have only been able to figure out how to get "rad" to out put the result for a single cell in "tempK". However I need it to do this for every cell in "tempK" and I need the output of "rad" to be the same dimensions as "tempK" (i.e. I need each all the converted values from "tempK" to have the same cell locations in "rad").
Any help on this would be very much appreciated.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!