Community Profile

# David Hill

Last seen: 4 dagar 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

All

#### Content Feed

View by

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

7 dagar 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))

7 dagar 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)...

13 dagar 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)

13 dagar 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),:); ...

13 dagar 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,...

13 dagar 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 dagar 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...

14 dagar 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*...

14 dagar ago | 0

Single bit read returning invalid precision

14 dagar 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...

14 dagar 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 dagar 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 dagar ago | 0

| accepted

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

17 dagar ago | 0

How do I replace every value in a column with a value from a lookup table?
interp1(X,Y,A)

18 dagar 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 dagar 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 dagar 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 dagar ago | 0

| accepted

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

29 dagar 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...

Solved

Matrix Transposition
Given a matrix and an index, perform matrix transposition as follows - Replace non-corner value of ith ring from outside, with...

Problem selecting specific data in time series
d=diff(day(T.Datetime)); f=find(d==0); F=[f;f+1]; newT=T(F(:),:);

ungefär en månad ago | 0

| accepted

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

ungefär en månad 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'))

ungefär en månad 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...

How to plot digital sequence in MATLAB
n=1:length(u); a=1.7; plot(n,a.^n.*u);%assuming u is a vector

ungefär en månad ago | 0

| accepted

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

ungefär en månad ago | 0

| accepted