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 ?

 採用された回答

Oleg Komarov
Oleg Komarov 2011 年 8 月 18 日

0 投票

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 件のコメント

Chaklader Asfak
Chaklader Asfak 2011 年 8 月 18 日
thanks :)

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

その他の回答 (0 件)

製品

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by