Community Profile

photo

David Hill


Last seen: Today Active since 2017

Electrical Engineering with minors in Computer Science, Mathematics, and Creative Writing.

Working as Undergraduate Research Assistant in the field of Computational Photonics

Statistics

All
  • MATLAB Mini Hack Participant
  • Treasure Hunt Participant
  • 24 Month Streak
  • Revival Level 2
  • Promoter
  • Sequences And Series II Master
  • Personal Best Downloads Level 4
  • 5-Star Galaxy Level 4
  • Cody5 Easy Master
  • Number Manipulation II Master
  • Draw Letters
  • Cody Problems in Japanese Master

View badges

Content Feed

Answered
Difference Calculation between current value and a specified prior value
Not sure exactly what you are after, an example would be helpful. B=(x(1:10)-x(10:19))./x(10:19);

4 days ago | 0

Answered
Count the number of times a value repeats between certain rows in a matrix.
A=[2,5,15,65,102;2,65,1,105,55;65,104,15,19,5]; i=A(1,ismember(A(1,:),A(2,:)));

4 days ago | 0

Answered
why doesnt it work
function x = ss_dtmf(number,dt,nd,np) x=[]; for i=1:length(number) x = [x,ss_dtmf1(number(i),0:nd:dt),ss_dtmf1(12,0:np:dt...

5 days ago | 0

Answered
Split a vector into 2 oscillating vectors?
v1=zeros(1,500000); v2=zeros(1,500000); for k=1:100 v1((k-1)*5000+1:k*5000)=v((2*(k-1))*5000+1:(2*(k-1)+1)*5000); v2((k-...

5 days ago | 0

Answered
Number of rows based on frequency of one integer and position of another integer
r=unique(matrix(:,2)); r=r(end-4:end); n=nnz(matrix(:,1)==10&ismember(matrix(:,2),r));

6 days ago | 0

Answered
Index Out of Bound for 1x1 Array
Use readmatrix data1 = readmatrix('4665_10.85.txt');

13 days ago | 0

Answered
Merge selected column elements from two matrices into a new matrix
If the number of non-zeros is not constant in the combined cA,cB rows, then cT will need to be a cell array. for k=1:size(cA,1)...

20 days ago | 0

| accepted

Answered
ive tried doing it but i dont know why the plot is not right t=-2:0.1:2; if t<=-1 y=-5.*t-5; elseif t<0 y=t.^2+1; elseif t<1 y=pi.^t; elseif t>=1 y=pi+sin(pi
t=-2:.1:2; f=zeros(size(t)); f(t<=-1)=-5*(t(t<=-1))-5; f(t>-1&t<0)=t(t>-1&t<0).^2+1; f(t>=0&t<1)=pi.^(t(t>=0&t<1)); f(t>=1)...

24 days ago | 0

| accepted

Answered
If statement without loop
TR1_Ge70(TR1>TR1_Ge70(:,1))=0; for k=1:size(A,2) C(:,:,k)=A(:,k).*B; end

27 days ago | 0

Answered
sorting with respect to specific column
s=sortrows(yourMatrix,6);

28 days ago | 0

| accepted

Answered
Remove values from column that are close in value to each other
x=sort(x);%make sure x is sorted x(diff(x)<2)=[];

1 month ago | 1

Answered
How to change Matlab display format for numbers
Look at the options under format help format format bank

1 month ago | 0

| accepted

Answered
Creating plot with double x axis
Why not just use subplot? subplot(2,1,1) plot(u1,y) subplot(2,1,2) plot(u2,y)

1 month ago | 1

| accepted

Answered
arrangment matrix in special way
Z=zeros(4); d=[A;B;Z;Z;C]; D=d; for k=2:5 d=circshift(d,4,1); D=[D,d]; end

1 month ago | 0

| accepted

Answered
Attempting to plot a function with a for loop, but nothing is working.
kilotons=input('kilotons of blast'); i=1:2:50; con = (kilotons * (1.2*10^8))./(pi*i.^2); plot(i,con); ylabel('Concentration'...

2 months ago | 2

Answered
Passing a vector (array) into a differentiated function
syms x; f = x^2 -1; Df1 = diff((f)); Df2 = diff((Df1)); y = (0:0.05:1); F= double(subs(f,x,y)); DF1= double(subs(Df1,x,y))...

2 months ago | 1

| accepted

Answered
How to store multiple variables on Matlab?
If every line is related and numbers of the same kind (floating point), then storing in a matrix can be more efficient (use inde...

2 months ago | 1

Answered
Circe center coordinates and radius from coordinades ( A, B, C )
syms h k r x1 x2 x3 y1 y2 y3 eqn1=(x1-h)^2+(y1-k)^2==r^2; eqn2=(x2-h)^2+(y2-k)^2==r^2; eqn3=(x3-h)^2+(y3-k)^2==r^2; [H,K,R]=...

2 months ago | 0

| accepted

Answered
How can I make the program count the number of decimals of an inputted amount
if you don't care about zeros entered. x=46.4500000;%if this would be valid if ~isequal(floor(x*100),x*100) 'invalid' end...

2 months ago | 0

Answered
I want to get the mean of cells in column 4 based on the column 1 value.
m=floor(yourMatrix(:,1)); M=259:374; for k=1:length(M) n(k)=mean(yourMatrix(m==M(k),4)); end

2 months ago | 0

| accepted

Answered
Reading certain columns of data bigger than a number into one array smaller into another
for i = 1:length(namelist) filename = namelist{i}; data = readmatrix(filename);%try readmatrix High = [High;data(...

2 months ago | 0

Answered
making a exponential from a for loop
k=6*10.^(1:10); Cd=1.5*10.^(1:8);

2 months ago | 0

| accepted

Answered
Need help calling a function
Not exactly sure what you are asking. Do you want to call the last function in your main function? I simple way to look at the o...

2 months ago | 0

Answered
Find all possible combinations of string array
You could get all possible combinations and then index into your struct. [idxa,idxb,idxc]=ndgrid(1:5,1:3,1:7);

2 months ago | 0

Answered
Creating a column vector form data in table to meet specific requirements.
risk=ones(size(age)); risk(age>75|BMI>50)=3; risk(age>50&age<=75&BMI>40&BMI<=50)=2;

2 months ago | 0

| accepted

Answered
what changes can be made in the code?
function out = mycumsum (m) out = m(1); for i = 2:length(m) out(i)=out(i-1)+m(i); end

2 months ago | 0

Answered
how can do get this
You could simply look at the difference a=[5 9.8 15 6 10 9.5 9.7 9.8 9.8 9.8 9.8]; idx=find(diff(a)==0,1);

2 months ago | 0

| accepted

Answered
RS-232 Serial Communication (Mark-10)
Look at your manual for your instrument to set up the parameters s = serialport('COM1',115200);%create object s.DataBits=8; s...

2 months ago | 0

| accepted

Answered
What does this line really do?
Look at what this does. a=randi(2,1,20)-1 a(a==1)=-1%same as a(1,a==1)=-1 a(a==0)=1%same as a(1,a==0)=1;

2 months ago | 0

| accepted

Load more