首页 > 解决方案 > 在 macOS 上使用 Octave 运行脚本时出现分段错误

问题描述

在 macOS 上使用 Octave 5.2.0 运行脚本时出现分段错误。我的样本(在八度范围内工作)有问题,还是我运行脚本的方式有问题,或者它是 macOS 上 Octave 的错误?

octave BlackBody.m 
fatal: caught signal Segmentation fault: 11 -- stopping myself...
[1]    95607 segmentation fault  octave BlackBody.m

样本:

% simple model of the black body using MATLAB/Octave/Freemat
wavelength = 0.01:0.01:5.0;     % microns sweep over a range of wavelengths
T = 5000;                       % temperature in kelvin
F = 3.742./ ((wavelength.^5).*(exp(1.439e4./(wavelength*T))-1)) ; % gives the result in W/m2/um x 1e8
plot(wavelength,F);
xlabel('wavelength (\mum)');       %  add axis labels and plot title
ylabel('spectral intensity (W/m^2/\mum) x 10^8');
title('Blackbody Radiation');
legend(sprintf('T = %.0f K',T));

标签: macosoctave

解决方案


推荐阅读