Hi everyone ! can anyone help me to do this , thank you
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
mina massoud
il 14 Mag 2019
Commentato: mina massoud
il 14 Mag 2019
% 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 Commenti
Fangjun Jiang
il 14 Mag 2019
Modificato: Fangjun Jiang
il 14 Mag 2019
double check all the column numbers in your question and make sure they are correct.
Risposta accettata
madhan ravi
il 14 Mag 2019
Modificato: madhan ravi
il 14 Mag 2019
[~,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 Commenti
madhan ravi
il 14 Mag 2019
Modificato: madhan ravi
il 14 Mag 2019
Thank you :) Fangjun , you’re totally right.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Creating and Concatenating Matrices in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!