Community Profile

photo

David Hill


Last seen: 4 days ago Active since 2017

Electrical Engineering with minors in Computer Science and Mathematics. Working as Undergraduate Research Assistant in the field of Computational Photonics

Programming Languages:
Python, C++, C, Java, MATLAB, HTML, Arduino
Spoken Languages:
English, Spanish

Statistics

All
  • MATLAB Mini Hack Participant
  • Treasure Hunt Participant
  • 24 Month Streak
  • Revival Level 2
  • Magic Numbers Master
  • Word Puzzles Master
  • Personal Best Downloads Level 4
  • 5-Star Galaxy Level 4
  • Promoter
  • Sequences And Series II Master
  • Cody5 Easy Master
  • Number Manipulation II Master

View badges

Content Feed

Answered
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

Answered
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

Answered
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

Answered
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

Answered
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

Answered
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

Answered
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

Answered
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

Answered
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

Answered
Single bit read returning invalid precision
b=fread('a.wdq',1,'ubit1');%this does not work?

13 days ago | 0

Answered
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

Answered
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

Answered
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

Answered
Writing a summation code where i≠j
No loops needed G=sum(w.*x.*x','all')/sum(x.*x','all');

17 days ago | 0

Answered
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

Answered
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

Answered
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

Answered
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

Answered
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

Answered
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

Answered
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

Answered
Converting string to function/number
Look at eval function (normally not recommended). a='cos(1)'; eval(a)

1 month ago | 0

Answered
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

Answered
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

Answered
Replace NaN values in a matrix with values from another matrix
B(isnan(B))=A(isnan(B));

1 month ago | 0

| accepted

Answered
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

Load more