MATLAB: Finding negative numbers and showing where they are

6 次查看(过去 30 天)
load Saturated_Table % load tables
load SpecificHeat_Data
SAT = SaturatedTable; % storing the tables as variables
SH = SpecificHeatData;
NNeg = SaturatedTable(1:end , 2:end); % Selects 1st rown to the end, 2nd colum to the end of the table
%mustBeNonnegative(NNeg) %states that the values above must be nonnegative
if NNeg<0
disp(neg)
end

采纳的回答

Walter Roberson
Walter Roberson 2020-12-10
[row, column] = find(NNeg < 0)
  1 个评论
Walter Roberson
Walter Roberson 2020-12-10
while true
[row, column] = find(NNeg < 0, 1);
if isempty(row); break; end
newval = input( sprintf('Input non-negative for row %d column %d: ', row, columN);
if isnumeric(newval) && isscalar(newval)
NNeg(row, column) = newval;
end
end

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Tables 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by