colocar resultados en x,y,z cuando es un sistema con infinitas soluciones

2 views (last 30 days)
%% DATOS DEL SISTEMA
ui = [3 2-5; -1 2-1; -2 1 1];
b=[0;-8;-7];
% OPERACIONES
uiu=[ui b]; %Matriz aumentada
rangoui=rank(ui); %rango ui
rangouiu=rank(uiu); %Rango de uiu
debería = ui \ b;
% Análisis de raíces
nn=size(ui); n=nn(1); %numero de ecuaciones
si rangoui == rangouiu
si rangoui == n
soll=ui\b %solución única
más
display('TIENE INFINITAS SOLUCIONES')
final
más
display('NO TIENE SOLUCIÓN,ES INCOMPATIBLE,SISTEMA INCONSISTENTE')
final
  2 Comments
Jimena Vásquez Perales
Jimena Vásquez Perales on 9 Sep 2020
Buenas tardes, quisiera saber como puedo programar para que cuando el sistema sea con infinitas soluciones, bote un resultado para x,y o z; gracias de antemano

Sign in to comment.

Answers (1)

BOB MATHEW SYJI
BOB MATHEW SYJI on 12 Sep 2020
I think this should work.
ui = [3 2 -5; -1 2 -1; -2 1 1];
b=[0;-8;-7];
uiu=[ui b];
rangoui=rank(ui);
rangouiu=rank(uiu);
debera = ui \ b;
nn=size(ui); n=nn(1);
if rangoui == rangouiu
if rangoui == n
soll=ui\b;
else
disp('TIENE INFINITAS SOLUCIONES')
end
else
disp('NO TIENE SOLUCIÓN,ES INCOMPATIBLE,SISTEMA INCONSISTENTE')
end

Categories

Find more on ThingSpeak in Help Center and File Exchange

Products


Release

R2017a

Community Treasure Hunt

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

Start Hunting!