# David Hill

Electrical Engineering with minors in Computer Science, Mathematics, and Creative Writing.

Working as Undergraduate Research Assistant in the field of Computational Photonics

**Statistics**

RANK**47**

of 244 597

REPUTATION**3 300**

CONTRIBUTIONS

**0** Questions

**1 372** Answers

ANSWER ACCEPTANCE **
0.00%
**

VOTES RECEIVED**363**

RANK**3 283** of 17 083

REPUTATION**419**

AVERAGE RATING**4.80**

CONTRIBUTIONS**18** Files

DOWNLOADS **144**

ALL TIME DOWNLOADS**2966**

CONTRIBUTIONS**0 Posts**

CONTRIBUTIONS**0** Public Channels

AVERAGE RATING

CONTRIBUTIONS**0** Highlights

AVERAGE NO. OF LIKES

**Content Feed**

I am unsure of how I am getting this error

r=linspace(0.001,1,1000); s=0.75*((r.^3)./(exp(1).^(.75*r)));%error is here (multiplying by scalar does not need .*, but you ne...

ungefär 11 timmar ago | 0

make a matrix of values from questions from another matrix

qo = 2*[1,0,1,0]; set(0, 'DefaultUIControlFontSize', 20); LoadType=ones(size(qo)); for k=find(qo) LoadType(k) = menu...

ungefär 12 timmar ago | 0

| accepted

For loop and matrices w/ different elements?

B(i)=[m2.*A2x(i); m2.*A2y(i); I2*a2; m3*A3x(i); m3*A3y(i); I3*a3(i); m4*A4x(i)-F4x(i); 0];%ne...

ungefär 13 timmar ago | 0

| accepted

How to code with for loop loops without using ndgrid?

count=0; for c=5:6 for b=3:4 for a=1:2 count=count+1; d(count,:)=[a,b,c]; end ...

ungefär 13 timmar ago | 0

How to divide a vector into small groups

x=randi(100,30,1); X=reshape(x,2,[]); [~,idxGroup]=find(X==x(15));

ungefär 14 timmar ago | 0

| accepted

Extracting the sub-matrix

A = [1 2 3; 4 5 6; 7 8 9]; B=A(1:2,2:3); E=blkdiag(zeros(2),A);

ungefär 15 timmar ago | 1

| accepted

Not enough Input arguments in integral function

s=0:100; for t=1:numel(s) fun_W=@(k)real(c_k(k))./k.*sin(k*s(t)); W(t)=2/pi*integral(fun_W,0,Inf); end fu...

13 dagar ago | 1

| accepted

Solved

Find hen's weight.

If hen weights x kilos on two legs, how much does it weights on one leg? Output the result.

13 dagar ago

Solved

Opposite task convert binary numbers array into array of decimal numbers.

Opposite task convert binary numbers array into array of decimal numbers. Example x=[ 11001000 ; 11001001 ; 11001010 ...

13 dagar ago

Solved

Solve expression II

Solve given expression. alpha=0.1(-x-y-50)/(exp((-x-y-50)/10)-1) beta=5exp((-x+y-60)/20) result=alpha+beta;

13 dagar ago

Solved

Find product of eigenvalues of n*n magic matrix.

Find product of eigenvalues of n*n magic matrix. Example n=3 Matrix= [ 8 1 6; 3 5 7; 4 ...

13 dagar ago

How can I sum each 3 columns array?

m=movsum(x,3); y=m(:,1:3:end);

14 dagar ago | 1

| accepted

Cropping images around the center of an image with a particular size

I=imread('FP00000s323d04u_01.png'); i=I(144:367,144:367,:); imshow(i);

14 dagar ago | 0

Too many for loops, how to approach rearranging arrays problem differently?

a=1:10; b=10:19; sa=0;sb=0; for k=2:numel(a) sa=sa+sum(nchoosek(a,k),'all'); sb=sb+sum(nchoosek(b,k),'all'); end

14 dagar ago | 0

How can I fix random numbers in a for loop?

t=1:.1:10; for k=1:10 s1=randi(5)*sin(1*t)+randi(5)*sin(2*t); s2=randi(5)*sin(1*t)+randi(5)*sin(2*t); Diff(k)=(s1-s2); e...

14 dagar ago | 1

| accepted

Solved

Give prime Numbers upto n

You are given a input number x; print all the prime numbers less than equal to x.

16 dagar ago

Solved

Matrix rotation as per given angle

Given a user defined matrix and angle of rotation, rotate the elements of output matrix as clockwise or anti-clockwise. Angle wi...

16 dagar ago

Solved

Distance between two GPS Coordinates

A problem that arises when performing geographically weighted regression is determining the distance between GPS coordinates. GI...

16 dagar ago

Solved

Toolbox check part 3

In my ongoing quest to highlight obscure parts of MATLAB, the latest challenge is to take 2 string inputs, one a MATLAB toolbox ...

16 dagar ago

For loop broken ?

rho = (20-h(n)/1000)/(20+h(n)/1000)*1.225;%h(n) is always going to be zero rho = (20-h(n-1)/1000)/(20+h(n-1)/1000)*1.225;%did y...

16 dagar ago | 0

| accepted

How to save for loop output to column vector

No loops needed, although you never defined hbar. fvf= 2888.7; ccm = 3*10^8*100; h = 6.63*10^-34; v1 = ccm*fvf; invAvkg = 1...

16 dagar ago | 0

| accepted

Function Approximation and Interpolation

Something like this. f = @(x) exp(-x.^2); x = linspace(-1, 1, 9); G=vander(x); y=f(x); c=G\y'; f1=@(x)polyval(c,x); t=lin...

16 dagar ago | 0

| accepted

Finding top and bottom 10% of data

n=round(.1*numuel(yourMatrix)); [~,idx]=sort(yourMatrix); bottom=yourMatrix(idx(1:n)); top=yourMatrix(idx(end-*n+1:end));

16 dagar ago | 0

Can someone please debug my code?

You need to use some cell arrays since the number of lines is different in the loops. Also the calculation for Q has something w...

17 dagar ago | 0

Apply the same matrix index to another matrix (bootstrap for matrix processes)

g=[]; [a,b]=size(indices); for k=1:b g=[g,vector(repmat(indices(:,k),1,b)+[0:a:(b-1)*a])]; end

19 dagar ago | 0

How can I solve an equation with 4 vectors of unequal length?

Use ndgrid() g = 9.80665; mb = 1:0.5:20; r = 0.01:0.01:0.15; omega = 1800:1000:20000; omegarad =...

19 dagar ago | 1

| accepted