octave - 假设输入是 Octave 中的矩阵,如何将函数的输出变量的值格式化为矩阵
问题描述
我有一个功能:
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);`
当我为每个变量输入一个值时,它会为brighttemp
. 但是,当我为其中一个变量输入向量时,例如变量和[8, 9; 7, 8.5]
其他变量的int
单个值,我会返回如下输出brighttemp
: 20.727.812.924.3 而不是格式与输入向量相似的向量对于int
变量,像这样[20.7, 27.8; 12.9, 24.3]
。我该怎么做才能获得像后一个向量这样的输出?
解决方案
推荐阅读
- sql - 查找只有两行的表。访问 2016
- python - 熊猫样式背景渐变未显示在 jupyter 笔记本中
- exoplayer - 从 mp3 文件为 exoplayer 创建 DRM 内容
- php - 具有数据库列平均值的 CanvasJS 图表
- jenkins - 无法在 Jenkins Pipeline Post Stage 中传递变量
- cmake - 当不同的用户设置的 CMake 配置选项发生冲突时我该怎么办?
- c# - 车把 DateTimeFormat 助手
- javascript - 通过下拉过滤器缩小数据表
- kotlin - Flutter - 使用从 Kotlin 到 Dart 的事件通道获取数据
- tensorflow - Tensorflow 将单词的二维列表转换为其字符的索引