Info
Questa domanda è chiusa. Riaprila per modificarla o per rispondere.
A question about generating a matrix
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
If I want to have a matirx which follows the change of n, says when n=2, A=[0 1] when n=3,A=[0 0 1], n=5, A=[0 0 0 0 1]. How can I achieve this goal using code? Thank you.
0 Commenti
Risposte (1)
Bruno Luong
il 11 Ott 2018
clear A
A(n) = 1
2 Commenti
Bruno Luong
il 11 Ott 2018
Modificato: Bruno Luong
il 11 Ott 2018
Presumably you want "0" and not "o", add the following
A=A(:)
or
clear A
A(n,1) = 1
Questa domanda è chiusa.
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!