Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

sine curv by line

x = [0 45 90 135 180 225 270  315 360 405 450 495 540 585 630 675 720];
y = sin(x*3.14/180);
scatter(x,y);
line(x,y);
title('Plot title');
xlabel('X Axis');
ylabel('Y Axis');

print -dpng figure.png

valu object programe

a = int32(7)

b = a
a = a^4
print -dpng

Execute MATLAB/Octave Online

x=[0 45 90 135 180 225 270 315 360];
y=sin(x*3.14/180);
scatter(x,y);
title('plot title');
xlabel('x axis');
ylabel('yaxis');
print -dpng figure. png

printing a square plot

x =[1 2 3 4 5 6 7 8 9 10];
for i=1:10
y(i)=x(i)*x(i)
end
scatter(x,y);
title('Plot title');
xlabel('X Axis');
ylabel('Y Axis');

print -dpng figure.png

triangular wave

x=[1 2 3 4 5 6 7 8 9 10]
%x=[0 45 90 135 180 225 270 315 360 405 450 495 540 585 630 675 720];
%y=sin(x*pi/180);
for i=1:10
if (rem(i,2))==0
y(i)=1
else
y(i)=0
end
end
scatter(x,y);
line(x,y);
title("plot title");
xlabel("x axis");
ylabel("y axis");
print -dpng figure.png

Execute MATLAB/Octave Online

x=[0 0.0005 0.00102 0.00146 0.0023 0.0031 0.005 0.007 0.01 0.049 0.125 0.218 0.234 0.306 0.33 0.348 0.36 0.366];
y=[0 102.3 204.7 293.5 272.9 264 268.9 267.6 264 318.6 372 394.4 395 384.2 360.4 327.5 290 266.8];


scatter(x,y);
plot(x,y);
title('Stress-Strain Curve');
xlabel('Eng Strain');
ylabel('Eng Stress');

print -dpng figure.png

phasetest

x = [1 2 3 4 5 6 7 8 9 10];
y1 = [.16 .08 .04 .02 .013 .007 .004 .002 .001 .0008 ];
y2 = [.16 .07 .03 .01 .008 .003 .0008 .0003 .00007 .00002 ];

semilogy(x,y1,'-bo;y1;',x,y2,'-kx;y2;');
title('Plot title');
xlabel('X Axis');
ylabel('Y Axis');

print -dpng figure.p

function result = PhaseUpdate(phase, phase_array,weight, bias, freq, tau)
A=phase_array - bias - phase; 
WSum=sum(w.*sin(A));
result= phase+(2*pi*freq + weight.*WSum)/tau;
end

Execute MATLAB/Octave Online

ad=@(a,b,c,d) a+b+c+d;

3. Matlab command

date    %display date

pwd     %display tha current path

dir     %display all the file in current directory

%type demo.m     %DISPLAY THE CONTAIN OF FILE

%other many command on file and input/output

x=[1 2 3 4 5]
y=[1 2 3 4 5]

cat (x,y)

%at the time of working used

mine

x = [0 1 2 3 4];
y = [1 5 10 22 38];
xy =x.*y;
x2=x.^2;
S1=sum(x);
S2=sum(y);
S3=sum(xy);
S=sum(x2);
U=[a;b]

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.