I have a function:
int = input("Introduce the intensity: ")
wave = input("Introduce the wavelength: ");
e = input("Introduce e: ");
function [brighttemp] = brightness_temp_function(int, wave, e)
A = 1.19 .* (10 .^ 8);
B = 1.441 .* (10 .^ 4);
brighttemp = sprintf("%.2f",(B ./ (wave .* (log (1 .+ ((e .* A) ./ (int .* (power(wave,5)))))))) .- 273.15);
disp(brighttemp);
endfunction
[brighttemp] = brightness_temp_function(wave, e, int);`
When I enter a single value for each variable, it outputs a single answer for brighttemp
. But when I enter in a vector for one of the variables, such as [8, 9; 7, 8.5]
for the int
variable and single values for the others, I get back an output like this for brighttemp
: 20.727.812.924.3 instead of a vector similar in format to the vector inputted for the int
variable, like this [20.7, 27.8; 12.9, 24.3]
. What do I have to do to get an output like the latter vector?