Community Profile

# David Hill

Last seen: Today 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

How to replace unique interval of columns in each row of a matrix with zero?
Why is a for-loop not acceptable? for k=1:length(idx_column) A1(k,1:idx_column(k))=0; end

2 jours ago | 0

Solved

List odd twin composites
Twin primes, or prime numbers that differ by 2 (e.g., 17 and 19, 59 and 61, or 191 and 193), are the subject of several Cody pro...

5 jours ago

I have matrix K and Z
s=logical(sum(Z,2)); K(s,:)=0;

5 jours ago | 0

Index exceeds the number of array elements - Error message
mdata = [1 2 3 4 5 6 7 8 9 10]; k = 1; c = 1; for n1 = 1:2:length(mdata) ma(c) = (1/(k + 1)) * sum(mdata(n1:n1 + k))...

6 jours ago | 0

Solved

Convert single-precision floating-point number to binary representation
Write a function which takes a scalar <http://en.wikipedia.org/wiki/Single-precision_floating-point_format single-precision floa...

6 jours ago

Solved

Convert base 10 to base x (2-16)
Convert input number(s) (cell array of character arrays) in base 10 to base x (2 through 16). Output should be a cell of charact...

6 jours ago

Finding the max value in 1st column of values based on a range in the 2nd column of values
idx=(FFTDataCKASRoll(:,2)>=.09&FFTDataCKASRoll(:,2)<=.11)|... (FFTDataCKASRoll(:,2)>=.19&FFTDataCKASRoll(:,2)<=.21)|... ...

6 jours ago | 0

| accepted

How to averaging each each row in cell array?
d=cell2mat(dst_allfiles); m=mean(d,2);

7 jours ago | 0

| accepted

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

16 jours 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))

16 jours 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)...

22 jours 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)

22 jours 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),:); ...

22 jours 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,...

22 jours 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);

22 jours ago | 1

| accepted

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

23 jours 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*...

23 jours ago | 0

Single bit read returning invalid precision

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

23 jours 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}...

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

23 jours ago | 0

| accepted

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

26 jours ago | 0

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

27 jours 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)

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

27 jours 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

28 jours 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));

environ un mois 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');

environ un mois ago | 0