converting octave to matlab
조회 수: 21 (최근 30일)
이전 댓글 표시
Hello everyone. I want to know how can I convert a code written in octave to matlab. Please help me. Thanks in advance.
댓글 수: 1
Natalia
2024년 11월 10일
Olá a todos. Quero saber como posso converter um código escrito em octave para matlab. Por favor, me ajudem. Agradeço antecipadamente.
답변 (2개)
madhan ravi
2018년 10월 20일
Try the fileexchange: https://in.mathworks.com/matlabcentral/fileexchange/8972-oct2ml
댓글 수: 2
Mohd Sufian
2021년 8월 1일
You can easily extract it by using 7zip or WINRAR on windows
for 7zip you have to extract it 2 time
Nurullah sany
2021년 9월 17일
편집: Walter Roberson
2024년 11월 10일
A=[1 1 1; 2 1 3; 3 4 -2];
B=[4;7;9];
n=length(B);
Aug= [A B]
for i=1:n
Aug(i,:)=Aug(i,:)./Aug(i,i);
for j=1:n
if j~=i
key1=Aug(j,i)./Aug(i,i);
Aug(j,:)=Aug(j,:)-key1.*Aug(i,:);
end
end
end
fprintf('Solution of the given system \n');
disp(Aug(:,end)
댓글 수: 1
DGM
2024년 11월 10일
편집: DGM
2024년 11월 10일
Have you tried it? There's nothing here that's Octave-specific. For sake of making the solution unique-valued, I'm going to tweak the inputs.
% slightly modified inputs
A = [1 1 1; 2 1.5 3; 3 4 -2];
B = [4;7;9];
n = length(B);
Aug = [A B];
for i = 1:n
Aug(i,:) = Aug(i,:)./Aug(i,i);
for j = 1:n
if j ~= i
key1 = Aug(j,i)./Aug(i,i);
Aug(j,:) = Aug(j,:) - key1.*Aug(i,:);
end
end
end
% this is a clumsy way to display it here, but okay
fprintf('Solution of the given system \n')
disp(Aug(:,end))
Of course, this whole thing isn't necessary unless you were told to solve it that way. See mldivide, \
% same thing
A = [1 1 1; 2 1.5 3; 3 4 -2];
b = [4;7;9];
x = A\b % solve
참고 항목
카테고리
Help Center 및 File Exchange에서 Octave에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!