フィルターのクリア

How do I only display the rows for when column 1 is > 0 when I have 4 columns with corresponding data to the first column

3 ビュー (過去 30 日間)
-0.00502163330810033 -0.00535602354270113 -0.00175905055456396 -0.00195122013126169
0.0191518806112861 0.0232968219264112 0.0157208477869482 0.0189597476631202
In this instance I only want to be showing the bottom row. To put it into context there's 1278 rows, basically just want to filter out all of the rows where the number in column 1 is a negative
  2 件のコメント
Christopher Wolfe
Christopher Wolfe 2021 年 9 月 12 日
The returns were for these figures above were denoted as The returns are denoted in this line rets = log(price(2:end,:)./price(1:end-1,:));
Walter Roberson
Walter Roberson 2021 年 9 月 12 日
How does this differ from your other question ?

サインインしてコメントする。

回答 (1 件)

Chunru
Chunru 2021 年 9 月 12 日
a = [-0.00502163330810033 -0.00535602354270113 -0.00175905055456396 -0.00195122013126169
0.0191518806112861 0.0232968219264112 0.0157208477869482 0.0189597476631202];
b = a(a(:,1)>0, :) % this list the a where 1st column>0
b = 1×4
0.0192 0.0233 0.0157 0.0190

カテゴリ

Help Center および File ExchangeTime Series Collections についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by