필터 지우기
필터 지우기

I need help with converting this to matlab

조회 수: 1 (최근 30일)
omer
omer 2013년 4월 9일
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

채택된 답변

Image Analyst
Image Analyst 2013년 4월 9일
Try input() or inputdlg(). Try that. Come back with your attempt if you still have problems.
  댓글 수: 3
Image Analyst
Image Analyst 2013년 4월 9일
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 2013년 4월 9일
thank you so much

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by