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
  • Treasure Hunt Participant
  • 24 Month Streak
  • Revival Level 2
  • Promoter
  • Sequences And Series II Master
  • 5-Star Galaxy Level 3
  • Personal Best Downloads Level 3
  • Cody5 Easy Master
  • Number Manipulation II Master
  • Draw Letters
  • Cody Problems in Japanese Master
  • Cody Challenge Master

View badges

Content Feed

Answered
How can I find same arrays in cell of arrays?
c=1; for m=1:41 for n=m+1:42 if isequal(A{m}(:,1:2),A{n}(:,1:2)) idx(c,:)=[m,n];%index pairs that have matchi...

1 day ago | 0

Answered
How to retrieve the list of numbers from which the average of a normal simulation is derived?
n = 5000; %Number of Simulations, sample size x1 = 75:125; %Mean simulation range y1 = 1:40; %Standard Deviation range N=...

1 day ago | 0

| accepted

Answered
Creating m by 2 matrix
[a,b]=max(A,[],2); M=[a,b];

1 day ago | 0

Answered
How to do math to entirety of a vector?
[1:selectSpaces(1),diff(selectSpaces)+1:selectSpaces(2)];

1 day ago | 0

Answered
how inverse number ?
Output=2*abs(Input-2);

3 days ago | 1

Answered
How to reset a variable in a for loop?
Use indexing. X=1+rand(1,10); for i=1:10 Y=X(i)+5;%whatever you do. end

5 days ago | 0

Answered
Convert list of indices to array
x=reshape(yourMatrix(:,4),[3],[3],[3]);

6 days ago | 1

Answered
indexing into an array
[~,idx]=ismember(B,A(:,1)); C=A(idx,:);

6 days ago | 0

| accepted

Answered
Initializing all rows with one set of values in one half and another set in the other half
cA=repmat([cA0*ones(1,(N-1)/2+1),Kw/cB0*ones(1,(N+1)/2-1)],number_of_rows,1);

6 days ago | 0

Answered
Random number selection from matrix column and from decimal number
[A(randi(3,1,4)+[0 3 6 9]),rand(1,2)];

15 days ago | 0

Answered
How to store array?
x=0:.1:3; for k=1:length(x) A=[5*x(k),0;2*x(k)^2,1] B=[0;2.55] Y(:,k)=A\B; end

15 days ago | 1

Answered
How to fill a matrix with formula
y=reshape(y,5,[])';

16 days ago | 1

| accepted

Answered
Create table of means from multiple tables
temp=T1.Properties.VariableNames; T=array2table((T1{:,:}+T2{:,:}+T3{:,:})/3); T.Properties.VariableNames=temp;

18 days ago | 0

Answered
Printing out zeros as empty character for a tex file
s=sprintf([num2str(i) ' & ' num2str(myData(i,1), format)... ' & ' num2str(myData(i,2), format) ... ' & ' nu...

1 month ago | 0

| accepted

Answered
Change error bar colour and data point colour in a loop
errorbar(x(i),y(i),err(i),'o', 'LineWidth', 2, 'MarkerFaceColor','g','Color','g');

1 month ago | 1

| accepted

Answered
How do I randomly extract 20 segments of data from a signal?
You could just keep matrix form with a 3rd dimension for k=1:20 newMatrix(:,:,k)=yourMatrix(randperm(60001,1000),:); end

1 month ago | 0

Answered
Plotting the function of single variable
n0 = 400; r0 = 1/n0; gamma = 1.26; p=20;%assumed s=.7;%assumed P=1:(p+1); r=r0*gamma.^(0:p); N=@(t)r0*n0*(2*s/(2*s-1))^(p...

1 month ago | 0

Answered
how to plot cell array continuously as line
y = cell2mat(A(1:20)); plot(1:numel(y),y);

1 month ago | 0

Answered
selecting 2 bits from given input bit stream alternatively
A=reshape(a,2,[])'; b=A(1:2:end,:); c=A(2:2:end,:);%matrix form %you could also convert to binary A=sum(A.*[2 1],2); b=dec2...

1 month ago | 0

| accepted

Answered
how to solve equation
y=zeros(size(x)); y(x==1)=3; y(x~=1)=x(x~=1).^3+55;

1 month ago | 0

Answered
How can I properly format small numbers using num2str?
soly=num2str(y,'%.3E') solx=num2str(x,'%.3E')

1 month ago | 0

| accepted

Answered
how to sum array
B'+A;

2 months ago | 0

Answered
Insert column of strings into numerical matrix
Cannot put date strings into a matrix of numbers. Convert date strings to numbers (datenum) and insert. If you want the date str...

2 months ago | 0

Answered
how do i write this in matlab?
syms x i=0:.1:1; for k=0:10 for j=1:11 K(j,k+1)=int(euler(k,x),x,[0,i(j)]); end end K=double(K);

2 months ago | 0

| accepted

Answered
How to reverse a Ax=b system of equation to find an A value from a x and b value
R1=4000; R2=8000; syms R3; R4=2000; R5=5000; v=125; A=[0 R2 0 R4 0 0 -R1 R2 -R3 0 0 0 0 0 R3 R4 -R5 0 1 1...

2 months ago | 0

| accepted

Answered
How to calculate coefficient of variation for every element in Matrix?
cv=std(datan,0,'all')/mean(datan,'all');

2 months ago | 1

Answered
Save vales in Harry in a for loop
No loop needed. Ri_A=numbA_IntStat./(E_i.*cos(numbGrad).*ds);%assuming all the same sized variables

2 months ago | 2

Answered
how can i integrate a function which has three variables but has to integrate it with respect to only one variable
For example: syms a b d e t; f=d^2*cos(e)/exp(t); I=int(f,e,a,b);

2 months ago | 0

Answered
Surface plot from excel data
a=readmatrix('test1.xlsx'); x=a(1,2:end); y=a(2:end,1); z=a(2:end,2:end); [X,Y]=meshgrid(x,y); surf(X,Y,z)

2 months ago | 1

| accepted

Answered
I'm new in matlab and I'm having trouble with the coding
x=(2*s*(4*s^2+19*s+20))/(20*s^4+66*s^3+73*s^2+57*s+30);%s is scalar x=(2*s.*(4*s.^2+19*s+20))./(20*s.^4+66*s.^3+73*s.^2+57*s+30...

2 months ago | 0

Load more