Solved


Harmonic series counting
The function takes a positive limit as input, And counts how many terms must be summed in the harmonic series: 1/1, 1/2, 1/3, ...

3 years ago

Solved


01-01: 正弦波の生成
「MATLABで学ぶ実践画像・音声処理入門」のプログラム1-1 と同じ正弦波を、サンプリング周波数 10kHz で生成し、返却する関数を作成せよ。

3 years ago

Solved


Compute the Lagarias Riemann Hypothesis sequence
Write a function that takes an input number and produces a sequence (i.e., all values up to and including the th value) compute...

3 years ago

Solved


Solve an equation involving primes and fractions
Write a function to find pairs of primes and satisfying the equation where is an integer. The function should take a numbe...

3 years ago

Solved


Easy Sequences 83: Digits of Powers of 3
This problem is a simpler version of 'Easy Sequences 82: Digits of Powers of 2'. Given integers and , we are asked to return th...

3 years ago

Solved


Dyck words
A Dyck word can be considered as a string of n X's and n Y's arranged to have at least as many X's in an initial segment of the ...

3 years ago

Solved


Easy Sequences 86: The "real" Hyperprimorials
In Easy Sequences 85, we define the hyperprimorial of , as a exponent ladder of primes numbers from the -th prime down to first ...

3 years ago

Solved


Easy Sequences 85: Hyperprimorials
Given an integer , the primorial of , , is defined as product of all primes from to the -th prime. In other words, if is the ...

3 years ago

Answered
How to find two values in a 3D table?
B=[ 16 17 17 17 19 17 23 22 22 22 24 24 31 29 28 27 29 31 38 36 ...

3 years ago | 1

| accepted

Answered
Correlation with two matrices
You could just manually do it yourself. A=randi(100,10);B=randi(100,10); M=mean(A);N=mean(B); r=zeros(size(A,2),size(B,2)); ...

3 years ago | 1

Answered
How to draw tangent plot?
fplot(@tan,[0,2*pi])

3 years ago | 0

Answered
Location of a value in a matrix
x=0:.5:20; f=find(x==9.5) x(f)

3 years ago | 0

Answered
ELEMENTS IN ODD COLUMNS AND ROWS
M=randi(100,10) out=imp_index(M) function out = imp_index(M) out=M(1:2:end,1:2:end); out=out(:)'; end

3 years ago | 1

Answered
Creating array based on highest values using for loop
x=zeros(1000,16); c=1; for i=Peaks x(:,c)=Reshaped_array(i:999+i,c); c=c+1; end

3 years ago | 0

| accepted

Answered
generating matrices from another matrix
x = [1,0,0,1,0,1]; d = diag(x); s(:,:,1)=d; for k=2:10 t=d;t(k)=1; s(:,:,k)=t'; end s

3 years ago | 0

Answered
using a Monte Carlo simulation with 100,000 trials to find the probability of a random integer that is larger than the other random integer in [4,21]
trials= 100000; % 100,000 trials A=repmat((4:21)',1,trials); B=randi([4 21],18,trials); A_win=sum(A>B,2); A_win_or_equal...

3 years ago | 1

| accepted

Answered
Running Script 100 Times to get Mean
x=normrnd(0,2,100); y=mean(90*exp(0.25*x+0.0175),2); histogram(y,20)

3 years ago | 0

Answered
How to append in a while loop?
Where is 'a' assigned? Lots of guessing here, but this might help you. limit =0.01; Ad= (linspace(-2.5,2.5,26))'; b=2;a=1; ...

3 years ago | 1

| accepted

Answered
Why does the solution contain the c1 variable even though I set the conditions?
Problem with y(0) condition (log(0) = -inf) syms y(x) ode = diff(y) == 2+y/x; cond = y(.001) == 0; ySol = dsolve(ode,cond) ...

3 years ago | 1

Answered
RK4 Function Code
dydx = @(x,y) 3.*exp(-x)-0.4*y; [x,y] = rk4(dydx,0,100,-0.5,0.5); plot(x,y,'o-'); function [x,y] = rk4(dydx,xo,xf,yo,h...

3 years ago | 0

Answered
How to find equal values/words between two string vectors?
a=["10", "25", "V4E", "64", "33"]; b=["64","V4E", "T2S", "10", "11"]; c=find(ismember(a,b)) d=a(c)

3 years ago | 1

| accepted

Answered
How can I fix this error?
f = @(x)4./(1+x.^2) a = 0; b = 1; F = @(x)-8*x./(1+x.^2).^2 % antiderivative of f ref = F(b) - F(a); n = 2; x = linspace...

3 years ago | 0

Answered
calculate a double integral in a function
f = @(x,y) sin(2*x).*sin(y); Bmn = findBmn(1,2,f) function Bmn = findBmn(m,n,f) a = pi; fun = @(x,y) f(x,y).*sin(n...

3 years ago | 0

| accepted

Answered
For Loop help for function input
r=randi(2,5,4); r(r==2)=5

3 years ago | 0

| accepted

Answered
Convert 8x3 char to string sequence (MATLAB)
val=['011' '010' '001' '000' '000' '001' '010' '011'] val=val' val=val(:)'

3 years ago | 0

Answered
Empty plot returning when I try to graph
[i,j]=meshgrid(1:1000); xtip=i/1000-.1; y=(j-500)/1000; rr=hypot(xtip,y); K=.5605; M=K./(sqrt(2*pi*rr)); plot(rr,M, "--");...

3 years ago | 0

Answered
loading multiple xlsx files using for loop and readmatrix
for k=1:7 data{k}=readmatrix(sprintf('model_%d.xlsx',k));%create cell array assuming the sizes are not the same end

3 years ago | 0

| accepted

Answered
Displaying even numbers in a series
n=1:.5:10; n(mod(n,2)==0)

3 years ago | 1

| accepted

Answered
I would do I calculate the surface area of an abnormal shape?
pgon(i)=polyshape(g(:,1),g(:,2)); plot(pgon(i)); A(i)=area(pgon(i));

3 years ago | 0

| accepted

Answered
How to categorize elements in a matrix based on positive or negative terms and assign them '0' and '1'
A=[ 0.468505878281799 -1.90580778081907 -2.25397431420907 -3.46546394734966 0.488991442582022 -1.68349064240944 0.37733413...

3 years ago | 0

| accepted

Load more