I have a problem with this code when i run

15 次查看(过去 30 天)
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 个评论
Rik
Rik 2017-11-9
You can find guidelines for posting homework on this forum here.
Jan
Jan 2017-11-10
@Stoian Andrei: You forgot to mention the problem. It is much easier to suggest a solution than to guess, what the problem is.

请先登录,再进行评论。

回答(1 个)

Walter Roberson
Walter Roberson 2017-11-10
A=[v1; v2 ;v3 ;v4; v5];

类别

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