how to increase the decimal place and it must be side to side as below

1 visualización (últimos 30 días)
Ali Al raeesi
Ali Al raeesi el 29 de Mzo. de 2021
Respondida: dpb el 29 de Mzo. de 2021
The matrix is not strictly diagonally dominant at row 1(ignore this)
approximated, exact=
0.18221-0.73861i 0.18233-0.73524i
0.0032185-0.22997i 0.0022028-0.22863i
========================================
answer of my code is below it must be like the above answer
approximated=
0.1822 - 0.7386i
0.0032 - 0.2300i
exact=
0.1823 - 0.7352i
0.0022 - 0.2286i
=============================================

Respuestas (1)

dpb
dpb el 29 de Mzo. de 2021
fmt=['%0.4f%+0.4fi\t%0.4f%+0.4fi\n'];
>> for i=1:size(approx,2)
fprintf(fmt,real(approx(i)),imag(approx(i)),real(exact(i)),imag(exact(i)))
end
0.1822-0.7386i 0.1823-0.7352i
0.0032-0.2300i 0.0022-0.2286i
>>
Will leave adding header line as exercise...

Categorías

Más información sobre Operating on Diagonal Matrices en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by