フィルターのクリア

Hi everyone ! can anyone help me to do this , thank you

1 回表示 (過去 30 日間)
mina massoud
mina massoud 2019 年 5 月 14 日
コメント済み: mina massoud 2019 年 5 月 14 日
% I'd like to take the first 4x4 block of X and put it in Xa and Xb
% in such a way as to take the first and second column of X and put it in the first and second column in Xa
% and take the third column and the fourth column of X and put it in the third and fourth column of Xb
% second block 4x4 of X
% the (5,6) column of X in the (5,6) column of Xa
% the (7,8) column of X in the (5,6) column of Xb
clear all
clc
P=2;
M=4;
X=rand(M,P*M);
Xa=zeros(M,P*M);
Xb=zeros(M,P*M);
  2 件のコメント
Fangjun Jiang
Fangjun Jiang 2019 年 5 月 14 日
編集済み: Fangjun Jiang 2019 年 5 月 14 日
double check all the column numbers in your question and make sure they are correct.
mina massoud
mina massoud 2019 年 5 月 14 日
yes you are wright becasue at the end i need to make somthing like this for P=4:-
Xa(:,1:2)= X(:,1:2)
Xb(:,3:4)= X(:,3:4)
Xa(:,5:6)= X(:,5:6)
Xb(:,7:8)= X(:,7:8)
Xa(:,9:10)= X(:,9:10)
Xb(:,11:12)= X(:,11:12)
Xa(:,13:14)= X(:,13:14)
Xb(:,15:16)= X(:,15:16)
so can i do it with somthing more general , thank u

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

採用された回答

madhan ravi
madhan ravi 2019 年 5 月 14 日
編集済み: madhan ravi 2019 年 5 月 14 日
[~,n]=size(X);
xai=[1:4:n,2:4:n];
xbi=[3:4:n,4:4:n];
Xa(:,xai)=X(:,xai)
Xb(:,xbi)=X(:,xbi)
  3 件のコメント
madhan ravi
madhan ravi 2019 年 5 月 14 日
編集済み: madhan ravi 2019 年 5 月 14 日
Thank you :) Fangjun , you’re totally right.
mina massoud
mina massoud 2019 年 5 月 14 日
thank you guys very much , i really appreciate it :)

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeArray Geometries and Analysis についてさらに検索

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by