Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1)
- A=[3 7 15; 2 4 7;7 -2 9]
- B=[19; 11; 13]
- x = A\B
- v1 = [5 3 7 8 11 13 9 17 4 2]
- v2 = round(rand(10,1)*16+3)
- vs=v1.*v2'
- ss=dot(v1,v2')
- v3 = [v1 v2']
- v3(3:11)
- v3(4:end)
- v3([2 7 12])
- M=diag(v1)
- det(M)
- trace(M)
- ------------------------------------------
- 2)
- subplot(2,1,1);
- x=10:10:1000;
- y=3*log(x);
- plot(x,y,'--r')
- xlabel('Osa x')
- ylabel('Osa y')
- title('Prubeh funkce y=3ln(x)')
- grid on
- legend('y')
- subplot(2,1,2);
- [x,y]=meshgrid([-3.1:0.1:3.1]);
- z=3*sin(2*x.*y)-2*cos(3*x.*y);
- plot3(x,y,z)
- colormap autumn
- view(-65,35)
- grid off
- -------------------------------------------------------
- 3)
- h=get(handles.listbox1,'Value');
- r=str2num(get(handles.edit1,'String'))
- v=str2num(get(handles.edit2,'String'))
- switch h
- case 1
- o=2*pi*r;
- q1='Obvod kružnice je:'
- q2=num2str(o)
- case 2
- o=pi*r.^2;
- q1= 'Obsah kruhu je:'
- q2=num2str(o)
- case 3
- o=pi*(r.^2)*v
- q1='Objem valce je:'
- q2=num2str(o)
- otherwise
- o=1;
- q1='Chyba je'
- q2=num2str(0)
- end
- set(handles.text3,'String',q1)
- set(hanldes.edit3,'String',q2)
- push button
- clear all
- clc
- close
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement