Concatenating values to form a matrix
3 ビュー (過去 30 日間)
古いコメントを表示
I am trying to loop through a table filed to return values greater than 10.
I am only getting ones in the resulting matrix.
I intend to get the values instead. Please my code below:
Year = [];
for i = 1:size(D, 1)
if (any(D(i, 2:13) > 10))
rows = [Year, i];
Year = [D(Year), D(i)];
Value = [D(rows,2:13)];
TableValue10 = [Year & Value]
end
end
1 件のコメント
Mathieu NOE
2021 年 4 月 26 日
hello
the & implies you are doing a logical comparison between Year and Value
I guess you wanted something else like : TableValue10 = [Year Value] or TableValue10 = [Year ; Value]
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!