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

suspect

function [mistaken, position] = suspect( initials, familiar )
j=1;
k=1;
position =[];
mistaken ={};
for i=1:length(familiar)
if familiar(1,i)== 0
initials(1,i)
mistaken{1,j}=initials{1,i};
j=j+1;
end
if familiar(1,i)== 1
position(1,k)=i;
k=k+1;
end   
end

%%---------------------------------------------------------------------

Now how to call the function

 A={'AV ','AL ','WL ','NB ','EB ','AS '}; % Intialise the A as cell not matrix or vector

l=[1, 1,0,1,1,0];
l=logical(l); % convert l to logical

[m,n]=suspect(A,l); % to call the function

pra1

t0=1;
t1=1;
dt=0.1;
N=(t1-t0)/dt;
c1=100;
t=[t0:dt:t1];

k=1.725
for i=1:N
    c(i+1)=c(i)-k*c(i)*dt;
end


Execute MATLAB/Octave Online

% compute the force of gravity between two objects given their masses and the distance between them
% masses are assumed to already exist in the workspace
mass1=81 %weight of mass 1 in kg. I used JBH weight in kg to confirm the lbs output at the end to be JBH weight in pounds
mass2=5.98*10^24; %weight of mass 2 in kg. I used earth's mass
distance= 6.371*10^6; %distance between centers of masses in meters. I used the radius of the earth to get from the center of earth to the center of my mass (which sits on the perimeter of the earth)
LBS_TO_NEWTONS_RATIO=4.4537;
gravitationalForceNewtons=(6.674*10^-11)*((mass1*mass2)/distance^2) % calculation taking the universal gravitation force formula and multiplying the masses which gets divided by the distance squared
gravitationalForceLbs=gravitationalForceNewtons/LBS_TO_NEWTONS_RATIO %using the constant assumption that 1 pound on Earth is the same as 4.4537 Newtons of force on Earth. This should end up at 178ish lbs

%attempt to code the exoweight.m script
%take weight in Earth pounds to print output of weight on 3 other celestial bodies (Venus, Mars, Jupiter) to be confirmed against website https://www.onlineconversion.com/weight_on_other_planets.htm
%Mars mass 6.39*10^23 kg radius 3390 km
%Venus mass 4.867*10^24 kg radius 6052 km
%Jupiter mass 1.898*10^27 kg radius 69911 km
MASS_MARS=6.39*10^23;
MASS_VENUS=4.867*10^24;
MASS_JUPITER=1.898*10^27;
RADIUS_MARS=3.390*10^6;
RADIUS_VENUS=6.052*10^6;
RADIUS_JUPITER=6.9911*10^7;
LB_TO_KG=0.454;
KG_TO_NEWTON=9.81;
%userWeight=input('what is your weight') %need to delete the percent symbol at the leading edge of this line whenever you've figured out how to get the user input
%mass1=userWeight; %need to delete the percent symbol at the leading edge of this line whenever you've figured out how to get the user input
% I cannot figure out how to call the code from the compute_gravitational_force.m to use it here for these three calculations. What I have done below just calculates each individual situation which is NOT the RIGHT way, but works
mass2=MASS_MARS;
distance=RADIUS_MARS;
marsWeight=((6.674*10^-11)*((mass1*mass2)/distance^2))/KG_TO_NEWTON/LB_TO_KG
mass2=MASS_VENUS;
distance=RADIUS_VENUS;
venusWeight=((6.674*10^-11)*((mass1*mass2)/distance^2))/KG_TO_NEWTON/LB_TO_KG
mass2=MASS_JUPITER;
distance=RADIUS_JUPITER;
jupiterWeight=((6.674*10^-11)*((mass1*mass2)/distance^2))/KG_TO_NEWTON/LB_TO_KG
%you will need to add semicolons after the jupiterWeight, venusWeight, and marsWeight lines in order to suppress the outputs until you know how to format the output in sentences, "You would weigh 67.49 lbs on Mars." "You would weigh 161.29 lbs on Venus." "You would weigh 471.36 lbs on Jupiter."

news

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.png

salam

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.png

smothning.m

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.png

Execute MATLAB/Octave Online

z = [0 2.3 4.9 9.1 13.7 18.3 22.9 27.2]
T = [22.8 22.8 22.8 20.6 13.9 11.7 11.1 11.1]
z = z'
T = T'

A = bsxfun( @power, z, 0:3 )
b = A'*T
AtA = A' * A

fprintf("Doing LU....\n\n")
[m,n]=size(AtA);
U=zeros(m);
L=zeros(m);
for j=1:m
    L(j,j)=1;
end
for j=1:m
    U(1,j)=AtA(1,j);
end
for i=2:m
    for j=1:m
        for k=1:i-1
            s1=0;
            if k==1
                s1=0;
            else
            for p=1:k-1
                s1=s1+L(i,p)*U(p,k);
            end
            end
            L(i,k)=(AtA(i,k)-s1)/U(k,k);
           end
         for k=i:m
             s2=0;
           for p=1:i-1
               s2=s2+L(i,p)*U(p,k);
           end
           U(i,k)=AtA(i,k)-s2;
         end
    end
end
L
U
% [L,U] = lu(AtA);
% L([1 4],:) = L([4 1],:);
% L([2 3],:) = L([3 2],:)
% U

fprintf("Doing LDLt....\n\n")
D = [U(1, 1) 0 0 0
0 U(2, 2) 0 0
0 0 U(3, 3) 0
0 0 0 U(4, 4)]
L
Lt = L'

fprintf("Substitution.....\n\n")
y = L \ b
z = D \ y
x = Lt \ z

first_derivative_of_x = fliplr(x')
%in C/m
fprintf('The gradient is: %f + x(%f + x(%f + x(%f)))\n\n', first_derivative_of_x(4), first_derivative_of_x(3), first_derivative_of_x(2), first_derivative_of_x(1))

second_derivative_of_x = polyder(polyder(first_derivative_of_x))
inflection_points = roots(second_derivative_of_x)


flux = polyval(first_derivative_of_x, inflection_points)/100 * 0.01 * 86400 * -1

fprintf("\n\n================================== VANDERMONDE ==================================\n")

A = bsxfun( @power, z, 0:7 )
AtA = A' * A














FYPP

I=imread('C:\Users\User\Desktop\Project\images\1495.jpg') 
imshow(I) 
title('Input Image')
 I1=rgb2gray(I);
 figure,imshow(I1) 
 title('gray converted Image')

Execute MATLAB/Octave Online

pkg load control

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');
s=tf('s')
g=(s+1)/(s+5)

hello

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.png

Advertisements
Loading...

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