Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %{
- a=32
- b=12
- function k = porownaj(a,b)
- if (a<b)
- k = -1 ;
- elseif (a>b)
- k = 1 ;
- else
- k = 0 ;
- end
- endfunction
- porownaj(a,b)
- %}
- %{
- x=[-5:0.01:5]
- function y= liczx(x)
- y=(x.^3)+(x.^2)-(3.*x)-3
- endfunction
- y=liczx(x)
- plot(x,y)
- %}
- %{
- A=rand(5)
- for k=A
- disp(A[1,k])
- endfor
- %}
- %{
- random = ones (1, 10);
- for i = 1:10
- random(i) = rand(1);
- endfor
- random
- %}
- %{
- slad=0
- random = rand (5, 5);
- for i = 1:5
- for j=1:5
- random(i,j) = round(random(i,j)*10);
- if(i==j)
- slad=slad+random(i,j);
- endif
- endfor
- endfor
- random
- slad
- %}
- x=[-5:0.01:5]
- function y= liczx(x)
- if (x<0)
- y=sin(x);
- elseif (x<1)
- y=x.^2;
- else
- y=1;
- endif
- endfunction
- y=liczx(x)
- plot(x,y)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement