
David Hill
Electrical Engineering with minors in Computer Science and Mathematics. Working as Undergraduate Research Assistant in the field of Computational Photonics
Python, C++, C, Java, MATLAB, HTML, Arduino
Spoken Languages:
English, Spanish
Statistics
RANK
41
of 260,099
REPUTATION
4,298
CONTRIBUTIONS
0 Questions
1,817 Answers
ANSWER ACCEPTANCE
0.00%
VOTES RECEIVED
465
RANK
2,569 of 17,886
REPUTATION
603
AVERAGE RATING
4.80
CONTRIBUTIONS
21 Files
DOWNLOADS
196
ALL TIME DOWNLOADS
4579
CONTRIBUTIONS
0 Posts
CONTRIBUTIONS
0 Public Channels
AVERAGE RATING
CONTRIBUTIONS
0 Highlights
AVERAGE NO. OF LIKES
Content Feed
What is the best way to define an output vector in this case?
I assume you mean a 10-element vector. for k=1:1000 yourVector=;%computation to compute your vector yourMatrix(k,:)=y...
6 days ago | 0
| accepted
Why does matlab not evaluate equations properly?
syms x f=log(.7*x+.5); x0=4.2857; t=taylor(f,x,x0,'Order',2); a= double(subs(t,6.42855))
6 days ago | 0
| accepted
why do I get the wrong angle
Recommend avoiding using symbolics. Seeking numerical solution, use fzero. mo=2.5; y=1.4; angle=10; fun=@(a)((2*(1+((y-1)/2)...
12 days ago | 0
why I get imaginary part using solve function
y=1.4; to3=300; t_star=400; eq4=@(m4)(((2*(y+1)*m4^2*(1+(y-1)/2)*m4^2))/(1+y*m4^2)^2)-to3/t_star; m_4=fzero(eq4,.8)
12 days ago | 0
Append values of nested loop into matrix
r=readmatrix('data_jong_edit.txt'); r(isnan(r(:,1)),:)=[]; u=unique(r(:,1)); for k=1:length(u) re=r(r(:,1)==u(k),:); ...
12 days ago | 0
why my plots are getting replaced after every simulation?
Question is confusing on figure numbering. Below saves 48 figures (16 each of s1, s2, and s3). Since you are saving the figures,...
12 days ago | 0
How to duplicate some values in vector , while each value is duplicate in different number of times?
a=[1 0 2 0 3 0 3 0]; d=4*(a>0)+3*(a==0); n=repelem(a,d);
13 days ago | 0
Why am I getting error "Vectors must be the same length" although they are of same length?
You have two 'Trial40' plot(subject_data.xcoordinates2{find(subject_data.trialname == 'Trial40',1)}, ... subject_data.ycoo...
13 days ago | 1
How to determine the reverse saturation current
missing * and some () in last equation N_a=1.0*10^22; N_d=1.0*10^22; ni=1.5*10^16; D_n=0.0025; tao_p0=5*10^(-7); tao_n0=5*...
13 days ago | 0
Single bit read returning invalid precision
b=fread('a.wdq',1,'ubit1');%this does not work?
13 days ago | 0
Matlab: How to plot the function $P(x)$ versus $x$, where $P(x)=\int_0^\infty f(y)W(x,y)dy$?
y=1:.01:5; x=0:.01:7; [X,Y]=meshgrid(x,y); W=exp(-X.^2./Y); f=y.^2;%as an example I=trapz(W.*f')/.01;%each column of I is t...
13 days ago | 0
How to find elements in common between two cell arrays?
load('B_90.mat'); A=B; load('B_120.mat'); I=intersect(A{1},B{1},'rows');%as an example points in common between A{1} and B{1}...
14 days ago | 1
| accepted
MATRIX PROBLEM IN MATLAB
You are indexing into regime with an array (aa) which is 1:2. Not sure what you want array (aa) to be: j=1:3; aa=1:(j+1);%this...
14 days ago | 0
| accepted
Writing a summation code where i≠j
No loops needed G=sum(w.*x.*x','all')/sum(x.*x','all');
17 days ago | 0
How do I replace every value in a column with a value from a lookup table?
interp1(X,Y,A)
17 days ago | 0
| accepted
how to I write sqrt{x}+sqrt{1+x}=4 in mathlab
eqn=@(x)sqrt(x)+sqrt(1+x)-4; f=fzero(eqn,3)
18 days ago | 0
| accepted
Randomly choose one nonzero element in each row of matrix
Need a single loop in third dimension. ex=randi(2,10,17,12)-1; E=permute(ex,[2,1,3]); [r,c]=find(E); N=zeros(size(ex,1),1,si...
18 days ago | 0
| accepted
How to write the program for pick the first five element from an array than next five and store their individual sum in new array?
a=randi(100,1,50);%an array n=sum(reshape(a,5,[]));%sum of 5 elements placed in new array
19 days ago | 0
| accepted
How to randomly select an array of 20 nonrepeating values from another array which has 100 values with positive or negative values.
a=randi(200,1,100)-100; SelectArray=a(randperm(100,20));
23 days ago | 0
string text manipulation - adding data based on previous data in the string
m=replace(m,'element1','element1CMD'); m=replace(m,'element2','element2CMD'); m=replace(m,'element3','element3RPT');
25 days ago | 0
The graph is coming out blank
Index and plot after completion of loop. f=@(x,y) -y/.1; x=input('\n Ingrese el valor inicial de x0: '); y=input('\n Ingres...
28 days ago | 1
Solved
Determine whether a number is practical
A number is practical if all smaller numbers can be written as a sum of the proper divisors of . The number 24 is practical bec...
1 month ago
Solved
Matrix Transposition
Given a matrix and an index, perform matrix transposition as follows - Replace non-corner value of ith ring from outside, with...
1 month ago
Problem selecting specific data in time series
d=diff(day(T.Datetime)); f=find(d==0); F=[f;f+1]; newT=T(F(:),:);
1 month ago | 0
| accepted
Converting string to function/number
Look at eval function (normally not recommended). a='cos(1)'; eval(a)
1 month ago | 0
How to divide a 2d array into blocks and create an array with the mean value of each block?
C=blockproc(B, [2 2], @(block_struct) mean(block_struct.data(:),'omitnan'))
1 month ago | 0
Solved
Define an arithmetic sequence
Given three numbers n, a, and d, define an arithmetic sequence of n terms with a being the initial term of the sequence and d be...
1 month ago
How to plot digital sequence in MATLAB
n=1:length(u); a=1.7; plot(n,a.^n.*u);%assuming u is a vector
1 month ago | 0
| accepted
Replace NaN values in a matrix with values from another matrix
B(isnan(B))=A(isnan(B));
1 month ago | 0
| accepted
Error using plot Vectors must be the same length.
t = linspace(0,1,n);%vector t needs to be same length as y_m
1 month ago | 0
| accepted