Community Profile

# David Hill

##### Last seen: Today
1.690 total contributions since 2017

View all

Contributions in
View by

Plot function with time step
I assume x is time then corresponding to your y-values with the given step starting at zero. x=0:.000999:4.057938;

etwa 19 Stunden ago | 0

Error when trying to run a function
function [g] = R(a,b,c,d) rou=880; Cd=0.7; Aorifice=1.963495408*(10^(-5)); Vo=7*10^(-5); Beta=1600*(10^5); Ap=(5.026...

etwa 19 Stunden ago | 0

How iterate inside a excel file and every 21 rows store values in a matrix?
I don't understand your question completely, but, I would put them all in a single matrix. XY=reshape(XY(1:42,1:2),21,[]);

etwa 20 Stunden ago | 1

How do I convert a cell array with different number of values to a matrix
for k=1:length(m) m{k}=[m{k},repmat(nan,1,5-length(m{k}))]; end m=cell2mat(m);

etwa 20 Stunden ago | 1

| accepted

Return Indices for x Smallest/Largest Values in Array
[~,idx]=sort(x); minIdx=idx(1:3);%for minimum 3 maxIdx=idx(end:-1:end-2);%for maximum 3

etwa 21 Stunden ago | 1

Function Requests and receives from the user the dimensions of the sampled matrix until a proper value is obtained
I would put your input into a continuous while loop and break the loop when the condition is met. function [m,n]=MatrixDimInput...

etwa 23 Stunden ago | 0

Calculate a monthly average from 3-hour data
If you want to simplify slightly, 8 readings * 30 days/month = 240 readings per month ... = 377 months = 90480 readings. Truncat...

etwa 23 Stunden ago | 0

How can I perform an operation on each element of a vector individually using a for loop?
No loop needed. [a,b]=pol2cart(Zp(:,3),Zp(:,2)); Zp=a+b.*i;

etwa 24 Stunden ago | 1

| accepted

Assign a number of random elements to different variables?
v=randperm(40); k=[]; while isempty(k) a=randi(40,1000,6);%you could change 40 to something smaller if you want to limi...

ein Tag ago | 1

| accepted

How can I plot the following in MATLAB?
Not sure if this is what you are looking for or not. for n=0:8 f=@(x)exp((1-cos(pi*x))/pi.*cos(n*pi*x)); b(n+1)=2*int...

2 Tage ago | 0

| accepted

change the distance between grid lines
Look at the following function: zticks()

2 Tage ago | 0

Values substitution of intervals.
x(x>=1400&x<=1500)=0;

2 Tage ago | 0

Two vectors to matrix sorted on occurrence
labels=5; hours=6; x=histcounts2(a(:,1),a(:,2),[labels,hours]);

2 Tage ago | 0

how to get function value?
syms a; b=2; e=0.9; q=1.2; g=2; k=3; d=0.5; f=(q*b*e/a-d*e)/((q^2)*(e^2)/a+2*e*g); df=diff(f); fvals=eval(subs(f,1:10))...

2 Tage ago | 0

how to calculate a row of number to be calculate in if else statement matlab
units=[0 800.09 364.73 776.42 695.21 698 338.67 498.05 426.35 713.48]; results=zeros(size(units)); results(units>900...

2 Tage ago | 0

| accepted

How to use if-function for arithmetic properties properly?
If you are trying to comute the ramanujan sum it should be something like this: function s = ramanujanSum(a,n) f=factor(a); s...

2 Tage ago | 0

Submitted

RIPEMD160 Hash
RIPEMD160 Hash of character array input of maximum length 8191

Submitted

Generates both uncompressed and compressed Bitcoin addresses from private key (either WIF or Hexadecimal)

How can i solve an equation with vector(s) and if this can be done using conditional statement
n=2.2; m=1.86; p=0.153; Qv=0.980; B=3.200; Rw=0.265; Rt=[4.05; 4.10; 4.22; 4.30; 4.38; 4.54; 4.82; 5.03; 5.23; 5.43; 5.64;...

3 Tage ago | 1

Rounding error when dividing
round(a/b,12);

3 Tage ago | 0

Output standard deviation and Mean
Function call. I would do the printing after the function call returns. But, this should work for you. [s,m]=mean_stdev(); Aft...

3 Tage ago | 0

| accepted

Confusion on Meshgrid and interp2
x = -0.5:0.1:0.5; y = -0.5:0.1:0.5; k = 0.77; [x,y] = meshgrid(x,y); z = k*(x.^2-y.^2); m = [-0.5 0 0.5]; n = [-0.5 -0.25...

3 Tage ago | 0

hex2dec return error
hex2dec('238a');

3 Tage ago | 1

how to change the pixel value for each of a list of pixels
I(m(:,1),m(:,2),m(:,3))=0;

3 Tage ago | 0

Leverrier method to find polynomial of matrix
function c = leverrier(A) a=size(A,1); M=zeros(a); c=zeros(1,a+1); c(1)=1; for k=2:a+1 M=A...

3 Tage ago | 1

| accepted

How can I obtain my expected result?
function out=picker(c,in1,in2) if c out=in1; else out=in2; end fprintf('out=%d',out);

3 Tage ago | 1

How can I construct all fairs of points?
a=nchoosek([1 2 3],2); b=[a; fliplr(a)];

3 Tage ago | 0

| accepted

Reduce Matrix by Adding Every Nth Rows and Nth Columns
m=m(1:20:8000,1:40,4000);

3 Tage ago | 0

| accepted