Solved


Function minimization - beat fminsearch!
Sequel of problem 45948 <https://www.mathworks.com/matlabcentral/cody/problems/45948-function-minimization-beat-fminbnd> M...

4 years ago

Solved


Function minimization - beat fminbnd!
Matlab's fminbnd function finds a minimizer of a function within an interval. If often gets stuck in local minima. Can you do...

4 years ago

Solved


Just another norm problem (JANP)
*Task:* Implement a function that takes a square matrix A and returns a nonzero vector yc which minimizes ...

4 years ago

Answered
matrix output multiplication and division
output(2,1)/output(2,2)

4 years ago | 0

Solved


Multiple by 4
multple ny 4

4 years ago

Solved


Add
add

4 years ago

Answered
how to plot the last 2000 points instead of the the full span?
Do you know the length of y? plot3(y(end-1999:end,1), y(end-1999:end,2), y(end-1999:end,3), '.')%or scatter3

4 years ago | 0

Answered
How to Plot Truncated Summation Functions without any add-ons
y=@(M,x)2/pi*sum((-1).^((1:M)-1).*cos(2*(1:M)-1)*pi/2.*x'./(2*(1:M)-1),2)+0.5; x=-10:10; plot(x,y(3,x),x,y(10,x),x,y(20,x));%p...

4 years ago | 0

Solved


Circle Division
A circle can be divided into 2 sections, by placing 2 points in arbitrary locations along its circumference and drawing a straig...

4 years ago

Answered
How can I create a custom probability distribution?
p = [0.2 0.3 0.5];%probabilities v = [3 7 10];%discrete values % P(X=3)=0.2, P(X=7)=0.3 and P(X=10)=0.5 Probability Mass Funct...

4 years ago | 0

Answered
for loop with the same variable but two values
No loop needed. Assumed yi and aa row vectors. bm=bm+yi.*b1; aam = aam+(yi'.*yi).*sqrt(aa'.*aa);

4 years ago | 0

Answered
Semilog in 3d scatter graph
set(gca,'xscale','log')

4 years ago | 0

| accepted

Answered
Unable to perform assignment because the left and right sides have a different number of elements
No loop is needed. x1=zeros(1,975); x2=zeros(1,975); k=25:30:1000; x1(k)=0.0062*exp(-80000./(8.31*k)); x2(k)= 0.23*exp(-148...

4 years ago | 2

| accepted

Answered
how to convert GPS week and second of the week into UTC?
File exchange: https://www.mathworks.com/matlabcentral/fileexchange/21193-utc-to-gps-time-coverter?s_tid=srchtitle

4 years ago | 0

Answered
I am trying to use an input for x and find e^x-1 and am enetering it as y=exp(x)-1 but it keeps just giving me the answer -1
You code is fine. exp(-11) is quite small. Change formating to long. Then run your code. format long;

4 years ago | 0

Answered
How to use the break command in nested loops?
while 1 flag=0; for i = 1:length(initial_solution.position) - 1 itabu = i; for j = i + 1:length(initial_solution.p...

4 years ago | 0

Solved


Evaluate Poker Hand
Given an input table of card values and card suits between five and thirteen cards, choose the best five cards and output the ra...

4 years ago

Problem


Evaluate Poker Hand
Given an input table of card values and card suits between five and thirteen cards, choose the best five cards and output the ra...

4 years ago | 1 | 6 solvers

Answered
multiplication table using for loop
a=0:5; mt=a*2

4 years ago | 0

Answered
How to find the indices of similar arrays
Do not understand your reference to arrays. Are you talking about row or columns in your matrix? I will assume you are talking a...

4 years ago | 0

| accepted

Answered
Why am I getting an answer "1×0 empty double row vector"?
Really too many points to do an effective scatter plot. Recommend reducing the size of beta. alpha1 = 3; alpha2 = 1.2; alpha3 =...

4 years ago | 0

Answered
Generating combination of matrix with 3 elements
So each row of 12 elements can only contain the elements [0 1 2] ? Are there any other contrains? How many times can each elemen...

4 years ago | 1

| accepted

Answered
for loop only gives me one value
Only one loop is needed. for m=1:nc %don't use the same indexing variable (you are already inside a loop) xi(m)= z1./(1+alp...

4 years ago | 1

| accepted

Answered
Delete zeros from an array using for loops
A = [1,0,2,3,0,0]; B=[]; for k=1:length(A) if A(k)~=0 B=[B,A(k)]; end end

4 years ago | 0

| accepted

Answered
Generating equations from MATLAB data
y=load('Hall_1_new.csv'); x=1:1505; f=fit(x',y','fourier5'); plot(x,y); hold on; plot(f);

4 years ago | 0

| accepted

Answered
How to create matrix array using while loop and time increment?
y1=y0+0.5*g*t.^2;%needs to be + (gravity is negative)

4 years ago | 1

Solved


find the second element of array
easy find the second element

4 years ago

Answered
Insert matrix double into single entry of a table
m=randi(100,30); t=cell2table({m});

4 years ago | 0

| accepted

Answered
Delete array elements with Coder compatibility
myStr(10)=[];

4 years ago | 0

| accepted

Load more