Calculate a matrix through a for loop

1 回表示 (過去 30 日間)
stelios loizidis
stelios loizidis 2019 年 5 月 28 日
コメント済み: stelios loizidis 2019 年 5 月 29 日
Hello,
I have the following code to which I am trying to find variable B. Veriable B is a matrix that will include the data in column 150.
for i=1:100
A=users(:,i) % users is a matrix 1140X100 logical
NonRev=(A==0)
possRec=NonRev.*CloUserRat %CloUserRat is a matrix 1140X1
[prices,ind]=sort(possRec)
if (prices>0)
B=ReMatrix(ind,150) %ReMatrix is a matrix 1140X837
end
end
When I run the code in Workspace, the variable B is not submerged and in the command window displays the message that the vabiable B is not defined. your help is valuable.
  4 件のコメント
Geoff Hayes
Geoff Hayes 2019 年 5 月 29 日
yes but if The prices matrix has a column that is in ascending and contains zeros and some non-zero numbers then how will the condition prices>0 be satisfied (if there are non-zer numbers in prices)?
stelios loizidis
stelios loizidis 2019 年 5 月 29 日
It is ok, I found and correted the error that was there. Thank you for your interest!!!

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeLinear Algebra についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by