converting octave to matlab

19 visualizaciones (últimos 30 días)
Shahrin Islam
Shahrin Islam el 20 de Oct. de 2018
Editada: Walter Roberson el 10 de Nov. de 2024
Hello everyone. I want to know how can I convert a code written in octave to matlab. Please help me. Thanks in advance.
  1 comentario
Natalia
Natalia el 10 de Nov. de 2024
Olá a todos. Quero saber como posso converter um código escrito em octave para matlab. Por favor, me ajudem. Agradeço antecipadamente.

Iniciar sesión para comentar.

Respuestas (2)

madhan ravi
madhan ravi el 20 de Oct. de 2018
  2 comentarios
Shahrin Islam
Shahrin Islam el 20 de Oct. de 2018
Thank you so much. But I am not able to extract it. Is there any other way?
Mohd  Sufian
Mohd Sufian el 1 de Ag. de 2021
You can easily extract it by using 7zip or WINRAR on windows
for 7zip you have to extract it 2 time

Iniciar sesión para comentar.


Nurullah sany
Nurullah sany el 17 de Sept. de 2021
Editada: Walter Roberson el 10 de Nov. de 2024
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 comentario
DGM
DGM el 10 de Nov. de 2024
Editada: DGM el 10 de Nov. de 2024
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')
Solution of the given system
disp(Aug(:,end))
-3.0000 5.3333 1.6667
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
x = 3×1
-3.0000 5.3333 1.6667
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>

Iniciar sesión para comentar.

Categorías

Más información sobre Octave 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