I need help with converting this to matlab

Input the n x n matrix A and n element vector b
for k = 1 to n
for i = k + 1 to n
lik aik=akk
for j = k + 1 to n
aij to aij - likakj
end for
end for
end for

 Respuesta aceptada

Image Analyst
Image Analyst el 9 de Abr. de 2013

0 votos

Try input() or inputdlg(). Try that. Come back with your attempt if you still have problems.

3 comentarios

omer
omer el 9 de Abr. de 2013
thanks for answer , but ı still have problem because I started to learn new , if dont mind, could you write the pseudocode in matlab form
n = 3
dialog_title = 'Input';
numberOfLines = 1;
for row = 1 : n
prompt = sprintf('Enter %d numbers for row #%d, separated by spaces', n, row);
userResponse = inputdlg(prompt,dialog_title,numberOfLines)
A(row, :) = .....% You do it.
end
A
See if you can get the line I indicated as "You do it". It might involve str2double, strsplit, cell2mat, and userResponse(1).
omer
omer el 9 de Abr. de 2013
thank you so much

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Etiquetas

Preguntada:

el 9 de Abr. de 2013

Community Treasure Hunt

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

Start Hunting!

Translated by