Community Profile

# David Hill

##### Last seen: Today
1,697 total contributions since 2017

#### David Hill's Badges

View all

Contributions in
View by

function Soru6 aci=input('Lütfen açıyı giriniz : '); F=input('Lütfen kuvveti giriniz : '); mesnet function mesnet ...

4 hours ago | 0

my code won't run or publish
m = 2; n = 1; for i = 1:100000 q = 3*rand(1); if q < 1 m = m/2; n = n/2; elseif q < 2 m = m...

4 hours ago | 1

Replace single quotation with single quotation and double quotation
B=[char(34),A,char(34)]; B=['"',A,'"'];%or this as long as A is a character array

4 hours ago | 0

function out=showMe(in) n=1; out=executeSub(); function o=executeSub()%I assume you are talking about a nested fun...

4 hours ago | 0

for loop showing only last iteration and the graph shows dotted instead of lines
clc close all clear syms x y E v=[x y]; J=jacobian([y,E*(1-x^2)*y-x], v); p=[0 0]; j=subs(J,v,p); a=-8:0.1:8; for E=1:l...

8 hours ago | 0

Scatter plot of two matrix of same size
scatter(x(:),y(:));%after reading x and y in, make sure the matrix size is the same and of type double

9 hours ago | 0

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;

1 day ago | 1

| accepted

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...

1 day 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,[]);

1 day 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);

1 day 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

1 day 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...

1 day 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...

1 day 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;

1 day 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...

1 day 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 days ago | 0

| accepted

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

3 days ago | 0

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

3 days ago | 0

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

3 days 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))...

3 days 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...

3 days 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...

3 days ago | 0

Submitted

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

3 days ago | 3 downloads |

Submitted

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

3 days ago | 7 downloads |

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 days ago | 1

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

3 days 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 days ago | 0

| accepted