# 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 242,546

REPUTATION**3,188**

CONTRIBUTIONS

**0** Questions

**1,334** Answers

ANSWER ACCEPTANCE **
0.00%
**

VOTES RECEIVED**349**

RANK**3,453** of 16,998

REPUTATION**389**

AVERAGE RATING**4.80**

CONTRIBUTIONS**18** Files

DOWNLOADS **133**

ALL TIME DOWNLOADS**2816**

CONTRIBUTIONS**0 Posts**

CONTRIBUTIONS**0** Public Channels

AVERAGE RATING

CONTRIBUTIONS**0** Highlights

AVERAGE NO. OF LIKES

**Content Feed**

How can I find same arrays in cell of arrays?

c=1; for m=1:41 for n=m+1:42 if isequal(A{m}(:,1:2),A{n}(:,1:2)) idx(c,:)=[m,n];%index pairs that have matchi...

1 day ago | 0

How to retrieve the list of numbers from which the average of a normal simulation is derived?

n = 5000; %Number of Simulations, sample size x1 = 75:125; %Mean simulation range y1 = 1:40; %Standard Deviation range N=...

1 day ago | 0

| accepted

How to do math to entirety of a vector?

[1:selectSpaces(1),diff(selectSpaces)+1:selectSpaces(2)];

1 day ago | 0

How to reset a variable in a for loop?

Use indexing. X=1+rand(1,10); for i=1:10 Y=X(i)+5;%whatever you do. end

5 days ago | 0

Initializing all rows with one set of values in one half and another set in the other half

cA=repmat([cA0*ones(1,(N-1)/2+1),Kw/cB0*ones(1,(N+1)/2-1)],number_of_rows,1);

6 days ago | 0

Random number selection from matrix column and from decimal number

[A(randi(3,1,4)+[0 3 6 9]),rand(1,2)];

15 days ago | 0

How to store array?

x=0:.1:3; for k=1:length(x) A=[5*x(k),0;2*x(k)^2,1] B=[0;2.55] Y(:,k)=A\B; end

15 days ago | 1

Create table of means from multiple tables

temp=T1.Properties.VariableNames; T=array2table((T1{:,:}+T2{:,:}+T3{:,:})/3); T.Properties.VariableNames=temp;

18 days ago | 0

Printing out zeros as empty character for a tex file

s=sprintf([num2str(i) ' & ' num2str(myData(i,1), format)... ' & ' num2str(myData(i,2), format) ... ' & ' nu...

1 month ago | 0

| accepted

Change error bar colour and data point colour in a loop

errorbar(x(i),y(i),err(i),'o', 'LineWidth', 2, 'MarkerFaceColor','g','Color','g');

1 month ago | 1

| accepted

How do I randomly extract 20 segments of data from a signal?

You could just keep matrix form with a 3rd dimension for k=1:20 newMatrix(:,:,k)=yourMatrix(randperm(60001,1000),:); end

1 month ago | 0

Plotting the function of single variable

n0 = 400; r0 = 1/n0; gamma = 1.26; p=20;%assumed s=.7;%assumed P=1:(p+1); r=r0*gamma.^(0:p); N=@(t)r0*n0*(2*s/(2*s-1))^(p...

1 month ago | 0

how to plot cell array continuously as line

y = cell2mat(A(1:20)); plot(1:numel(y),y);

1 month ago | 0

selecting 2 bits from given input bit stream alternatively

A=reshape(a,2,[])'; b=A(1:2:end,:); c=A(2:2:end,:);%matrix form %you could also convert to binary A=sum(A.*[2 1],2); b=dec2...

1 month ago | 0

| accepted

How can I properly format small numbers using num2str?

soly=num2str(y,'%.3E') solx=num2str(x,'%.3E')

1 month ago | 0

| accepted

Insert column of strings into numerical matrix

Cannot put date strings into a matrix of numbers. Convert date strings to numbers (datenum) and insert. If you want the date str...

2 months ago | 0

how do i write this in matlab?

syms x i=0:.1:1; for k=0:10 for j=1:11 K(j,k+1)=int(euler(k,x),x,[0,i(j)]); end end K=double(K);

2 months ago | 0

| accepted

How to reverse a Ax=b system of equation to find an A value from a x and b value

R1=4000; R2=8000; syms R3; R4=2000; R5=5000; v=125; A=[0 R2 0 R4 0 0 -R1 R2 -R3 0 0 0 0 0 R3 R4 -R5 0 1 1...

2 months ago | 0

| accepted

How to calculate coefficient of variation for every element in Matrix?

cv=std(datan,0,'all')/mean(datan,'all');

2 months ago | 1

Save vales in Harry in a for loop

No loop needed. Ri_A=numbA_IntStat./(E_i.*cos(numbGrad).*ds);%assuming all the same sized variables

2 months ago | 2

how can i integrate a function which has three variables but has to integrate it with respect to only one variable

For example: syms a b d e t; f=d^2*cos(e)/exp(t); I=int(f,e,a,b);

2 months ago | 0

Surface plot from excel data

a=readmatrix('test1.xlsx'); x=a(1,2:end); y=a(2:end,1); z=a(2:end,2:end); [X,Y]=meshgrid(x,y); surf(X,Y,z)

2 months ago | 1

| accepted

I'm new in matlab and I'm having trouble with the coding

x=(2*s*(4*s^2+19*s+20))/(20*s^4+66*s^3+73*s^2+57*s+30);%s is scalar x=(2*s.*(4*s.^2+19*s+20))./(20*s.^4+66*s.^3+73*s.^2+57*s+30...

2 months ago | 0