フィルターのクリア

how to do this operation to calculate columns for a new matrix ?

3 ビュー (過去 30 日間)
Firas Al-Kharabsheh
Firas Al-Kharabsheh 2016 年 4 月 30 日
コメント済み: dpb 2016 年 5 月 2 日
if i have this matrix
A=[ 0 0 1 0 1 0 1 4 1 0
10 10 6 5 1 1 1 5 6 10 ]
and i found this matrix
a=[ 10 10 7 5 2 1 2 9 7 10 ]
and this matrix
b = [1 1 2 1 2 1 2 2 2 1 ]
i want to find this matrix F_Complete where
for k=1:10
if (a(k) + b(k) - 1) == 10 then
go back to A(k) and make group of ones depend on the number in the column(k) ( between each group there is zero )
like this
the first column in A = [0 >>>> make the condition true then put in F_complete(:,1) [ 1
10 ] 1
1
1
1
1
1
1
1
1 ]
the second column and last column in A just like the first column
the 8 column in A = [ 4 >>>> make the condition true then put in F_complete(:,8) [ 1
5 ] 1
1
1
0
1
1
1
1
1 ]
then the final solution will be
F_Complete = [ 1 1 0 0 0 0 0 1 0 1
1 1 0 0 0 0 0 1 0 1
1 1 0 0 0 0 0 1 0 1
1 1 0 0 0 0 0 1 0 1
1 1 0 0 0 0 0 0 0 1
1 1 0 0 0 0 0 1 0 1
1 1 0 0 0 0 0 1 0 1
1 1 0 0 0 0 0 1 0 1
1 1 0 0 0 0 0 1 0 1
1 1 0 0 0 0 0 1 0 1 ]
  3 件のコメント
Firas Al-Kharabsheh
Firas Al-Kharabsheh 2016 年 5 月 1 日
yes you solved it but this for rows matrix , on this question i want to do column in A by column
dpb
dpb 2016 年 5 月 2 日
Well, orientation shouldn't make much of a roadbloack, but primarily again your description of the rule by which you generate the output is very difficult to follow...I can't interpret how you got the above result from the input, sorry.

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB Coder についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by