Community Profile

# David Hill

Last seen: Today 2017 年からアクティブ

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

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

All

バッジを表示

#### Content Feed

Location of a value in a matrix
x=0:.5:20; f=find(x==9.5) x(f)

1日 前 | 0

ELEMENTS IN ODD COLUMNS AND ROWS
M=randi(100,10) out=imp_index(M) function out = imp_index(M) out=M(1:2:end,1:2:end); out=out(:)'; end

1日 前 | 1

Creating array based on highest values using for loop
x=zeros(1000,16); c=1; for i=Peaks x(:,c)=Reshaped_array(i:999+i,c); c=c+1; end

1日 前 | 0

| 採用済み

generating matrices from another matrix
x = [1,0,0,1,0,1]; d = diag(x); s(:,:,1)=d; for k=2:10 t=d;t(k)=1; s(:,:,k)=t'; end s

1日 前 | 0

using a Monte Carlo simulation with 100,000 trials to find the probability of a random integer that is larger than the other random integer in [4,21]
trials= 100000; % 100,000 trials A=repmat((4:21)',1,trials); B=randi([4 21],18,trials); A_win=sum(A>B,2); A_win_or_equal...

1日 前 | 1

| 採用済み

Running Script 100 Times to get Mean
x=normrnd(0,2,100); y=mean(90*exp(0.25*x+0.0175),2); histogram(y,20)

2日 前 | 0

How to append in a while loop?
Where is 'a' assigned? Lots of guessing here, but this might help you. limit =0.01; Ad= (linspace(-2.5,2.5,26))'; b=2;a=1; ...

2日 前 | 1

| 採用済み

Why does the solution contain the c1 variable even though I set the conditions?
Problem with y(0) condition (log(0) = -inf) syms y(x) ode = diff(y) == 2+y/x; cond = y(.001) == 0; ySol = dsolve(ode,cond) ...

3日 前 | 1

RK4 Function Code
dydx = @(x,y) 3.*exp(-x)-0.4*y; [x,y] = rk4(dydx,0,100,-0.5,0.5); plot(x,y,'o-'); function [x,y] = rk4(dydx,xo,xf,yo,h...

3日 前 | 0

How to find equal values/words between two string vectors?
a=["10", "25", "V4E", "64", "33"]; b=["64","V4E", "T2S", "10", "11"]; c=find(ismember(a,b)) d=a(c)

3日 前 | 1

| 採用済み

How can I fix this error?
f = @(x)4./(1+x.^2) a = 0; b = 1; F = @(x)-8*x./(1+x.^2).^2 % antiderivative of f ref = F(b) - F(a); n = 2; x = linspace...

3日 前 | 0

calculate a double integral in a function
f = @(x,y) sin(2*x).*sin(y); Bmn = findBmn(1,2,f) function Bmn = findBmn(m,n,f) a = pi; fun = @(x,y) f(x,y).*sin(n...

6日 前 | 0

| 採用済み

For Loop help for function input
r=randi(2,5,4); r(r==2)=5

6日 前 | 0

| 採用済み

Convert 8x3 char to string sequence (MATLAB)
val=['011' '010' '001' '000' '000' '001' '010' '011'] val=val' val=val(:)'

7日 前 | 0

Empty plot returning when I try to graph
[i,j]=meshgrid(1:1000); xtip=i/1000-.1; y=(j-500)/1000; rr=hypot(xtip,y); K=.5605; M=K./(sqrt(2*pi*rr)); plot(rr,M, "--");...

7日 前 | 0

for k=1:7 data{k}=readmatrix(sprintf('model_%d.xlsx',k));%create cell array assuming the sizes are not the same end

7日 前 | 0

| 採用済み

Displaying even numbers in a series
n=1:.5:10; n(mod(n,2)==0)

7日 前 | 1

| 採用済み

I would do I calculate the surface area of an abnormal shape?
pgon(i)=polyshape(g(:,1),g(:,2)); plot(pgon(i)); A(i)=area(pgon(i));

7日 前 | 0

| 採用済み

How to categorize elements in a matrix based on positive or negative terms and assign them '0' and '1'
A=[ 0.468505878281799 -1.90580778081907 -2.25397431420907 -3.46546394734966 0.488991442582022 -1.68349064240944 0.37733413...

7日 前 | 0

| 採用済み

For loop not stopping
Instead of a for-loop, just do it all at once. idx=aspect(:,1)==-9999; aspect(idx,1)=nan;

7日 前 | 0

| 採用済み

Select only some coordinates from a .txt file

7日 前 | 0

| 採用済み

Rearranging matrix of sth elements
n=1:1716; N=[]; for k=1:66 N=[N,n(k:66:end)]; end

8日 前 | 0

| 採用済み

writing binary number with specific length (MATLAB)
n=3; A=0.2; B=[0.7 0.5 0.3 0.1 0.1 0.3 0.5 0.7]; K=dec2bin(B/A,3)

8日 前 | 0

| 採用済み

how to use "randi" in specific case?
n=10;%length of matrix l=[10 15 20 25]; m=zeros(length(l),n); r1=randperm(length(l));r2=randperm(n,length(l));r3=randperm(len...

8日 前 | 0

How do I get the angle between three points input by ginput() in appdesigner?
z=[x,y]; d=diff(z); Angle=acos(dot(-d(1,:),d(2,:))/norm(d(1,:))/norm(d(2,:)));

8日 前 | 0

| 採用済み

how to change decimal point place
I am not sure how your numbers are stored. Are they stored as character arrays or doubles? a='3.261505126953125'; b=[a(1),',',...

8日 前 | 0

How to randomize points using a GUI
Please accept my previous answer if it was acceptable to you. GUI function GUI() f= figure; axes('Parent',f,'Position',...

8日 前 | 0

| 採用済み

How to fill the region formed by four lines?
beta11_um1 = @(delta11) 4.1797+0.396*delta11; beta11_lm1 = @(delta11) 0.4090+0.396*delta11; beta11_up1= @(delta11) 3.8058-0.4...

8日 前 | 2

| 採用済み

turning the loop answer into a vector
load data_matrix.mat data=SECTION_L; data(:,1:3)=[]; row=9; cleanup=data([1 2 3 row],:); c=1; for i = 1975:2016 for j...

8日 前 | 0

| 採用済み

Create a loop with condition
Does not seem like you need random values, but rather all values between -5 to 5 [x,y]=meshgrid(-5:.001:5);%generates all x0 pa...

9日 前 | 1

| 採用済み