Effacer les filtres
Effacer les filtres

Square Matrix

2 vues (au cours des 30 derniers jours)
Chaklader Asfak
Chaklader Asfak le 18 Août 2011
i have a very simple quetion. Say , a Matrix (5x1)named A.
A= [ 2;2;2;2;2 ]
How I can make a square matrix (5x5) with all 2 contained from command window taking the A from an excel file ?

Réponse acceptée

Oleg Komarov
Oleg Komarov le 18 Août 2011
If you want to take a vector from excel and replicate it such that the result is a square matrix, then:
a = xlsread('myfile.xlsx');
a = repmat(a(:),1,numel(a));
  1 commentaire
Chaklader Asfak
Chaklader Asfak le 18 Août 2011
thanks :)

Connectez-vous pour commenter.

Plus de réponses (0)

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by