Effacer les filtres
Effacer les filtres

trouble selecting column for function to return

2 vues (au cours des 30 derniers jours)
Scragmore
Scragmore le 22 Oct 2011
My code;
function Mat_abcd = mod_mx(x, y)
A = x;
B = bsxfun(@mod,x,y);
C = floor(bsxfun(@rdivide,x,y));
D = kron(C, y);
Mat_abcd = [A(:2), B(:2)];
Both A and B return multiple columns, I would like to return specific columns.
I have also tried
Mat_abcd = [A.series2, B.series2]
but this also returns an error. Please where am I going wrong.

Réponse acceptée

Image Analyst
Image Analyst le 22 Oct 2011
I don't know what x is, or A and B, but if A and B are 2D arrays, try this:
Mat_abcd = [A(:,2), B(:,2)];
You forgot the commas after the colons.
  1 commentaire
Scragmore
Scragmore le 22 Oct 2011
School boy error. Thanks.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Resizing and Reshaping Matrices dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by