Community Profile

# David Hill

### Carnegie Mellon University (CMU)

Last seen: Today Attivo dal 2017

Master's Student in Robotic Systems Development (MRSD), BS Electrical Engineering with minors in Computer Science and Mathematics.

Programming Languages:
Python, C++, C, Java, Javascript, R, MATLAB, CSS, Arduino
Spoken Languages:
English, Spanish
Professional Interests:
Robotics and Autonomous Systems, Embedded Systems

All

#### Content Feed

Visto da

Risposto
How to round numbers using the decimals as a probability?
A=10*rand(1,10) B=floor(A)+((A-floor(A))>rand(1,10))

circa 2 mesi fa | 0

| accettato

Risposto
Is there a function like movsum which simply gets the values in a given sliding window rather than summing them?
b=1:10; a=b; n=5;%window size for k=1:n-1 a=[a;circshift(b,-k)]; end a=a'; a=a(1:length(b)-n+1,:)

2 mesi fa | 0

Risposto
Create Number and excluding
No need for loops. A=randi([5,15],1,100); A(A==9|A==13)=[]; A

3 mesi fa | 0

Risposto
Analysing PWM duty cycle of a signal
s=pwm>threshold;%pwm is your signal, threshold is when it is considered on or off d=diff(s); idx1=find(s,1); idx2=find(d==-1)...

3 mesi fa | 0

Risposto
Storing Data and working out an equation
Just index, no loop needed. Filtered_Gear_rpm=rand(40000,1);%sample data Filtered_NES_rpm=rand(40000,1);%sample data x=Filter...

3 mesi fa | 0

Risposto
solve non-linear equation
Use fzero eqn=@(z)exp(-z)+pho*exp(L-2*z)-G;%you could plot the function to find the approximate location of the root z=fzero(e...

3 mesi fa | 0

| accettato

Risposto
Index in position 2 exceeds array bounds
for i = 1:numel(uniq) Tyro1{i} = table2cell(REQtyr(ismember(resSeq,uniq(i)),["AtomName","X","Y","Z"])); Tyro{i} = tabl...

3 mesi fa | 0

| accettato

Risposto
Error in for loop (issue with variable calling)
for i = 1:1 z1 = importdata("Xxsv0000"+num2str(i)+".txt"); Time{i} = z1.data(:,1); ...

3 mesi fa | 1

Risposto
Find column number for every row in matrix
a=[ -1 4 1 1 -1 -1 -5 4 -1]; A=(a>0)'; [b,d]=find(A); [~,e]=unique(d); b(e)

3 mesi fa | 0

Risposto
How do I crop a matrix within desired numerical limits?
M=[-2+16*rand(100,1),-17+9*rand(100,1),-3+5*rand(100,1)]; M(M(:,3)<-2|M(:,3)>1,:)=[]; M(M(:,2)<-16|M(:,2)>-9,:)=[]; M(M(:,1)<...

3 mesi fa | 0

Risposto
How to select vectors from a set of vectors
x=[1 1 1 1 0 0 0 0;1 0 0 0 1 1 1 0;0 1 0 0 1 0 0 1;0 0 1 0 0 1 0 1;0 0 0 1 0 0 1 0]; r=randi(8,1,500); y=x(:,r)

3 mesi fa | 1

| accettato

Risposto
I need to combine those three martix into a single big one. How do I do that?
blkdiag(randi(10,2),randi(10,2),randi(10,2))

3 mesi fa | 0

Risposto
Compare vector to two other vectors
m=randi(100,1,20); n=randi(100,1,30); k=randi(100,1,10000); [M,N]=meshgrid(m,n); x=min(M,N); z=zeros(size(x)); u=unique(x)...

3 mesi fa | 0

Risposto
Function might not be used error
[e,t,a]=CalcTip(100,3) [e,t,a]=CalcTip(100,4) [e,t,a]=CalcTip(100,5) [e,t,a]=CalcTip(100,2) function[error, tip, amoun...

3 mesi fa | 0

Risposto
Having trouble converting rpm to 1/s using unitConvert from symunit
You want rps u = symunit; n = 2950 * u.rpm; w = vpa(unitConvert(n,u.rps))

3 mesi fa | 1

Risposto
creating an array from a single user input
userinput = input('input nth value for fibonacci calculation:'); %define two empty matrices one for fibonacci values and one fo...

3 mesi fa | 0

| accettato

Risposto
low quality figure problem when saving as svg or pdf ( using fill function)
How is the quality different? My saved pdf looks just the same. x=rand(10,10); y=rand(10,10); z=rand(10,10); figure,axis equ...

3 mesi fa | 1

Risposto
removeData([2 3 0 0 7 8 0]) function [newVec] = removeData(vec) newVec = zeros(size(vec)); for x = 1:length(vec) %don't hav...

3 mesi fa | 0

Risposto
Easiest way to check if the point is on the land or on sea?
Do you have the mapping toolbox? Use https://www.mathworks.com/matlabcentral/fileexchange/48661-landmask If so it is as simple a...

3 mesi fa | 0

| accettato

Risposto
How can I load data from Excel file to Matlab in script and use the data loaded to calculate?

3 mesi fa | 1

Risposto
t test ( not sure if my implementation is correct)

3 mesi fa | 0

| accettato

Risposto
How can I load data from Excel file to Matlab in script and use the data loaded to calculate?

3 mesi fa | 1

Risposto
Greek character print in the command window, but not when I publish a script.
display(char(945)); display(char(946));

3 mesi fa | 0

Risposto
how to use elements from array to sort data
Keep your data stored in matrices that you can index into. numdata = xlsread("res Data.xlsx"); Q=numdata(1:5,:); F=numdata(6:...

3 mesi fa | 1

Risposto
How to create a function which takes one column of data as its input and another as its output
Just use the find function. find rng(1) A=randi(100,10,2) f=A(find(A(:,2)==88),1)

3 mesi fa | 0

| accettato

Risposto
Bessel Function Calculation in Matlab
You need to increase your k as z gets larger. n=sym(1); F(1)=n; for k=1:202 F(k+1)=F(k)*k; end J=zeros(1,60); for z=1:...

3 mesi fa | 1

Risposto
product between doubles 200*200
F= 1 -((1-prob1).*(1-prob2).*(1-prob3));

3 mesi fa | 0

| accettato

Risposto
How to make a 'case' go over each element in a vector ?
tcue = TIMES+floor(NS)-0.5;

4 mesi fa | 0

Risposto
Randomize vector avoiding consecutive values
leftSides = [1,3,5]; leftPos_trials = repmat(leftSides,1,14); idx=randperm(42); while any(diff(leftPos_trials(idx))==0) ...

4 mesi fa | 0

Risposto
Iteration over for loop using a vector
n_trial = 12; n_probe =7; longer_array = [1:84]; for trial = 1:n_trial for probe = 1:n_probe longer_array((trial...

4 mesi fa | 0

| accettato