a simple substitution problem !
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
i have a 2x2 matrix
u = [ 10 10 ; 5 5 ] ; for example
how can i use a simple code to transfer it to
u =
[ 0.5 10 ; 5 0.5 ]
i use
subs ( diag(u) , 0.5 );
but it didn't work
please help me with the problem!!!
thank you!
0 comentarios
Respuestas (3)
Azzi Abdelmalek
el 19 de Feb. de 2013
Editada: Azzi Abdelmalek
el 19 de Feb. de 2013
Edit
u = [ 10 10 ; 5 5 ];
y=u(:);
n=size(u,1);
y((1:n).^2)=0.5;
out=reshape(y,n,n)
0 comentarios
Ver también
Categorías
Más información sobre Octave en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!