Solved


Generate Hadamard Matrix without using hadamard function
In mathematics, a Hadamard matrix, named after the French mathematician Jacques Hadamard, is a square matrix whose entries are e...

3 years ago

Answered
Index exceeds the number of array elements. Index must not exceed 1.
You can do that without the loop W = 10000; S = 40; AR = 7; cd0 = 0.005; k = 1 / pi / AR; hv = 6:-.01:0; cdminp = 4*cd0...

3 years ago | 0

Answered
bring zeros on top of a matrix
Assuming elements are sorted row-wise A=[4 5 0 6;3 0 5 7;0 3 4 6]; "the answer needs to use loops" B=A'; C=B(:)'; for ix = ...

3 years ago | 0

| accepted

Solved


GJam 2017 Kickstart: Vote (Large)
This Challenge is derived from <http://code.google.com/codejam/contest/6304486/dashboard#s=p1 GJam 2017 Kickstart Vote>. This is...

3 years ago

Answered
How can we reduce the execution time of this whole code?
I am aware that pre-allocation speeds up the process, but pre-allocating an empty matrix doesn't reserve any memory for the oper...

3 years ago | 1

| accepted

Solved


Knight Moves?
One of my favorite games are chess. Let’s do something with chess. If you don’t know chess, that’s completely fine. You can stil...

3 years ago

Solved


GJam 2017 Kickstart: Vote (Small)
This Challenge is derived from <http://code.google.com/codejam/contest/6304486/dashboard#s=p1 GJam 2017 Kickstart Vote>. This is...

3 years ago

Solved


Magic!
Check whether the input matrix is a normal magic square: http://en.wikipedia.org/wiki/Magic_square Output the logical value tr...

3 years ago

Answered
Find the value from the integral equation
You can solve it symbollically (This requires symbolic toolbox) syms w m0 A=(cos(4*w)*cos(4*w)+1)/(1+exp(w-m0)); eq=int(A,w,-...

3 years ago | 1

Solved


Number of cyles and fixed points in a permutation
A permutation can be constructed from one or more sets of elements in cyclic order. A permutation in a single row vector form ...

3 years ago

Solved


Best Square-Shaped Grid for Subplot
If you have x number of plots, find the optimum 'm' number of rows and 'n' number of columns for subplotting where the overall f...

3 years ago

Answered
Which is the most accurate way to solve these equations?
"Which is the most accurate way to solve these equations?" Generally, the most accurate way to solve any equation is analytical...

3 years ago | 1

| accepted

Solved


Find the point of intersection of tangents.
Given two points on a conic, find the point of intersection of the corresponding tangents. The conic is given in Cartesian coor...

3 years ago

Answered
How can I use one row having full data whose elements repeat [like A(:,1) below] to query another data of the same type but having some elements missing?
A = [0 10; 0 20; 0 25; 1 30; 1 40; 2 50; 2 60; 3 70; 3 80; 4 90; 4 100; 5 10; 5 20; 5 35]; B = [0 110; 0 210; 1 300; 1 405; 2 6...

3 years ago | 1

Solved


Script file size
Determine the file size of a script, "function.m". This is the base scoring method for Cody and the Matlab Contests. A method ...

3 years ago

Solved


Verify Law of Large Numbers
If a large number of fair N-sided dice are rolled, the average of the simulated rolls is likely to be close to the mean of 1,2,....

3 years ago

Solved


Generate Hadamard Matrix
In mathematics, a Hadamard matrix, named after the French mathematician Jacques Hadamard, is a square matrix whose entries are e...

3 years ago

Answered
Taking one dimension of a matrix
in = rand(972,48,128); out = in(1,:,:); size(out)

3 years ago | 0

| accepted

Answered
Attempt to grow array along ambiguous dimension. it happens when N,M are smaller then the total of A,B. can I make my code work for any value of N,M? if so how would I do that
The number of elements in C is greater than the total number of elements pre-allocated in res. You can not put 22 elements in 2...

3 years ago | 0

| accepted

Answered
What is the function of this button? Where is the corresponding official document link?
The function of the button is to generate Fixed-point data via a dialog box. I don't know if there is a documentation specifica...

3 years ago | 0

Answered
Error using * Dimension do not match
As you can see here, Jac is 2x2, thus inv(Jac) will also be 2x2 and f is 1x2. The multiplication of 2x2 with 1x2 is not possible...

3 years ago | 0

| accepted

Answered
Homogenuous differential equation with conditions
j=22; y=[-8.2,0.6]; As you can see below, you are using non integer values as an index, which is not possible. i = -8.2:j+0.6...

3 years ago | 0

Answered
How do I plot the different elements of a matrix in a single plot?
for t = 0:1:100 omega1 = 0.02*cos(0.15*t) + 0.03*sin(0.15*t); omega2 = 0.03*cos(0.15*t) - 0.02*sin(.15*t); omega3...

3 years ago | 0

Answered
Generate array of sequence pairs without iteration
A combination of repelem and repmat - M=13;N=8; %corresponding arrays m=1:M;n=1:N; out1=[repelem(m',N,1) repmat(n',M,1)] ou...

3 years ago | 0

| accepted

Answered
How to store values in matrix form for differn iteration
Use reshape() %in case of row array x=1:3500; y=reshape(x,7,500)' %in case of column array a=(1:3500)'; b=reshape(a,7,500)...

3 years ago | 0

| accepted

Answered
Convert Equastion to Matlab Code
Transfer Function Model Example for reference

3 years ago | 1

Answered
How do i plot many short horizontal lines when a value is available?
%random data A=randi(100,1,10) B=randi(100,1,12) %You can not use max, because A has less elements than B elements N=min([nu...

3 years ago | 1

Answered
Convert numeric 2D array to array of orders of values
I couldn't think of a vectorized solution (yet), so here is the for loop approach. If and when I find a vectorized solution, I ...

3 years ago | 1

| accepted

Solved


feeling VERY lucky?
Just like Matthew's problem 2793 and Edward's problem 2872 (guess the number that Cody is thinking) but now you must solve it in...

3 years ago

Answered
Variable passed through function doesn't work
How are you calling the function? Also, Use strcmp or isequal to compare strings behavior = 'drug' isequal(behavior,'drug') ...

3 years ago | 0

| accepted

Load more