I have a problem with this code when i run

10 Ansichten (letzte 30 Tage)
Stoian Andrei
Stoian Andrei am 9 Nov. 2017
Kommentiert: Jan am 10 Nov. 2017
Hey guys can help me to rezolved my problem in this code .....
%Exercitiul 1
disp('Tema la MATLAB');
disp('Student: Stoian Andrei-Serban');
disp('Grupa:2105');
disp('Data:8.11.2017');
%Excercitul 2
v1=linspace(2,7,5);
disp('Vectorul liniar v1=');disp(v1);
v2=linspace(3,6,5);
disp('Vectorul liniar v2=');disp(v2);
v3=linspace(5,10,5);
disp('Vectorul liniar v3=');disp(v3);
v4=linspace(4,10,5);
disp('Vectorul liniar v4=');disp(v4);
v5=linspace(2,8,5);
disp('Vectorul liniar v5=');disp(v5);
%Exercitiul 3
A=[v1 v2 v3 v4 v5];
disp('Matrice generata de vectori este:->');disp(A);
disp('Diagonal principala a matricei este');disp(diag(A));
%Exercitiul 4
[a,b]=ind2sub(size(A),find (A>8));
disp('Linia este');disp(a);
disp('Coloana este');disp(b);
%Exercitiul 5
B=[-1 5.25 -0.8 7.85 6
2 -0.25 10.5 0.75 0
2 0.25 14.8 17.75 6.6
6 8.5 6 12.5 4
1 7.5 11.5 5.5 8];
disp('B='); disp(B);
C=A-B;
disp('C='); disp(C);
[c,d]=ind2sub(size(C),find(C==0));
disp('Nr. de linii') ;disp(c);
disp('Nr. de coloane');disp(d);
%Exercitiul 6
disp('Inversa matricei C este egala:-->');disp(C);
disp('Determinatul inversei lui C este:-->');disp(det(C'));
%Exercitiul 7
V=[28.3 -36.2 24.5 16.2 4.3];
r=V/r;
disp(r);
%Exercitiul 8
VV=v1+v2+v3+v4+v5;
disp(VV);
Radacina=roots(VV);
disp(Radacina);
%Exercitiul 9
n=4;
for i=1:n
for j=1:(n+2)
if i==7;D(i,j)=5;
elseif abs(i-j)==1; D(i,j)=-2;
else D(i,j)=4;
end
end
end
disp(D);
%Exercitiul 10
sum=0;
k=1;
while (VV(k)<=35)&&(k<=length(VV))
sum=sum+VV(k);
k=k+1;
end
%Exercitiul 11
x=0.3:0.1;
f=exp(x)-(3.*x);
plot(x,f)
  2 Kommentare
Rik
Rik am 9 Nov. 2017
You can find guidelines for posting homework on this forum here.
Jan
Jan am 10 Nov. 2017
@Stoian Andrei: You forgot to mention the problem. It is much easier to suggest a solution than to guess, what the problem is.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Walter Roberson
Walter Roberson am 10 Nov. 2017
A=[v1; v2 ;v3 ;v4; v5];

Kategorien

Mehr zu MATLAB finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by